This commit is contained in:
Timothy Jaeryang Baek
2026-07-26 23:54:16 -04:00
parent ba7c95f7ef
commit e5a08d5220
6 changed files with 106 additions and 1 deletions
+7
View File
@@ -138,6 +138,13 @@ export const setChatReadAt = (chatId: string, lastReadAt: number): boolean => {
return found;
};
export const setAllChatsRead = () => {
const updateChat = (chat: ChatListItem) => ({ ...chat, last_read_at: chat.updated_at });
chatsStore.update((items) => (items ? items.map(updateChat) : items));
pinnedChatsStore.update((items) => items.map(updateChat));
};
export const resetChatListState = () => {
requestGeneration += 1;
currentPage = 1;