Merge pull request #17832 from silentoplayz/pinned-chats-not-updating
fix: pinned chats not updating after archiving all chats
This commit is contained in:
commit
54ed62f7b0
|
|
@ -2,14 +2,22 @@
|
||||||
import fileSaver from 'file-saver';
|
import fileSaver from 'file-saver';
|
||||||
const { saveAs } = fileSaver;
|
const { saveAs } = fileSaver;
|
||||||
|
|
||||||
import { chats, user, settings, scrollPaginationEnabled, currentChatPage } from '$lib/stores';
|
import {
|
||||||
|
chats,
|
||||||
|
user,
|
||||||
|
settings,
|
||||||
|
scrollPaginationEnabled,
|
||||||
|
currentChatPage,
|
||||||
|
pinnedChats
|
||||||
|
} from '$lib/stores';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
archiveAllChats,
|
archiveAllChats,
|
||||||
deleteAllChats,
|
deleteAllChats,
|
||||||
getAllChats,
|
getAllChats,
|
||||||
getChatList,
|
getChatList,
|
||||||
importChat
|
importChat,
|
||||||
|
getPinnedChatList
|
||||||
} from '$lib/apis/chats';
|
} from '$lib/apis/chats';
|
||||||
import { getImportOrigin, convertOpenAIChats } from '$lib/utils';
|
import { getImportOrigin, convertOpenAIChats } from '$lib/utils';
|
||||||
import { onMount, getContext } from 'svelte';
|
import { onMount, getContext } from 'svelte';
|
||||||
|
|
@ -74,6 +82,7 @@
|
||||||
|
|
||||||
currentChatPage.set(1);
|
currentChatPage.set(1);
|
||||||
await chats.set(await getChatList(localStorage.token, $currentChatPage));
|
await chats.set(await getChatList(localStorage.token, $currentChatPage));
|
||||||
|
pinnedChats.set(await getPinnedChatList(localStorage.token));
|
||||||
scrollPaginationEnabled.set(true);
|
scrollPaginationEnabled.set(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -92,6 +101,7 @@
|
||||||
|
|
||||||
currentChatPage.set(1);
|
currentChatPage.set(1);
|
||||||
await chats.set(await getChatList(localStorage.token, $currentChatPage));
|
await chats.set(await getChatList(localStorage.token, $currentChatPage));
|
||||||
|
pinnedChats.set([]);
|
||||||
scrollPaginationEnabled.set(true);
|
scrollPaginationEnabled.set(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue