From 9fa830d57d3019dfaa60b57a98730855d413dd8e Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Sun, 12 Mar 2023 13:55:21 +0800 Subject: [PATCH] update migration --- src/store/migrate.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/store/migrate.ts b/src/store/migrate.ts index 1b777a2..3e53c2e 100644 --- a/src/store/migrate.ts +++ b/src/store/migrate.ts @@ -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 }; + }); };