Fix: Force pull images in deploy workflow
All checks were successful
Build and Push / build-all (push) Successful in 7m30s

This commit is contained in:
doomtube 2026-01-06 23:56:06 -05:00
parent 7f56f19e94
commit 0bb461498e
7 changed files with 104 additions and 23 deletions

View file

@ -119,8 +119,29 @@ export function clearMessages() {
}
// Set message history
export function setMessageHistory(messageList) {
messages.set(messageList);
// If merge=true, adds new messages to existing ones (for realm switching in global chat)
// If merge=false (default), replaces all messages (for initial connection)
export function setMessageHistory(messageList, merge = false) {
if (merge) {
messages.update((existing) => {
// Create a Map of existing messages by messageId for O(1) lookup
const existingMap = new Map(existing.map((m) => [m.messageId, m]));
// Add new messages that don't already exist
for (const msg of messageList) {
if (!existingMap.has(msg.messageId)) {
existingMap.set(msg.messageId, msg);
}
}
// Convert back to array and sort by timestamp
return Array.from(existingMap.values()).sort(
(a, b) => new Date(a.timestamp) - new Date(b.timestamp)
);
});
} else {
messages.set(messageList);
}
}
// Toggle channel