handle create new chatstore on diff model

This commit is contained in:
2023-03-29 12:51:31 +08:00
parent 2d7edeb5b0
commit 6406993e83

View File

@@ -121,13 +121,15 @@ export function App() {
const key = getDefaultParams("key", "");
const sys = getDefaultParams("sys", "");
const mode = getDefaultParams("mode", "");
const model = getDefaultParams("model", "");
// only create new chatStore if the params in URL are NOT
// equal to the current selected chatStore
if (
(api && api !== chatStore.apiEndpoint) ||
(key && key !== chatStore.apiKey) ||
(sys && sys !== chatStore.systemMessageContent) ||
(mode && mode !== (chatStore.streamMode ? "stream" : "fetch"))
(mode && mode !== (chatStore.streamMode ? "stream" : "fetch")) ||
(model && model !== chatStore.model)
) {
handleNewChatStore();
}