mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-16 18:52:12 +03:00
edcbb30e97
* feat: add chat config modal * feat: save chat config in localStorage * feat: remove <ConfigPage/> * feat: overwrite chat config with brain * fix(SettingsPage): upload payload keys * fix: update default brain marker logic * feat: set new created brain as current selected brain
21 lines
505 B
TypeScript
21 lines
505 B
TypeScript
import { ChatConfig } from "@/lib/context/ChatProvider/types";
|
|
|
|
export const saveChatConfigInLocalStorage = (
|
|
chatId: string,
|
|
chatConfig: ChatConfig
|
|
): void => {
|
|
localStorage.setItem(`chat-config-${chatId}`, JSON.stringify(chatConfig));
|
|
};
|
|
|
|
export const getChatConfigFromLocalStorage = (
|
|
chatId: string
|
|
): ChatConfig | undefined => {
|
|
const config = localStorage.getItem(`chat-config-${chatId}`);
|
|
|
|
if (config === null) {
|
|
return undefined;
|
|
}
|
|
|
|
return JSON.parse(config) as ChatConfig;
|
|
};
|