update migration

This commit is contained in:
Jing Hua 2023-03-12 13:55:21 +08:00
parent dd9290241f
commit 9fa830d57d

View file

@ -1,5 +1,9 @@
import { LocalStorageInterface } from '@type/chat';
import { defaultChatConfig } from '@constants/chat';
export const migrateV0 = (persistedState: LocalStorageInterface) => {
persistedState.chats.forEach((chat) => (chat.titleSet = false));
persistedState.chats.forEach((chat) => {
chat.titleSet = false;
if (!chat.config) chat.config = { ...defaultChatConfig };
});
};