mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 09:29:31 +08:00
feat: add tight border layout
This commit is contained in:
21
app/store.ts
21
app/store.ts
@@ -30,8 +30,18 @@ interface ChatConfig {
|
||||
submitKey: SubmitKey;
|
||||
avatar: string;
|
||||
theme: Theme;
|
||||
tightBorder: boolean;
|
||||
}
|
||||
|
||||
const DEFAULT_CONFIG: ChatConfig = {
|
||||
historyMessageCount: 5,
|
||||
sendBotMessages: false as boolean,
|
||||
submitKey: SubmitKey.CtrlEnter as SubmitKey,
|
||||
avatar: "1fae0",
|
||||
theme: Theme.Auto as Theme,
|
||||
tightBorder: false,
|
||||
};
|
||||
|
||||
interface ChatStat {
|
||||
tokenCount: number;
|
||||
wordCount: number;
|
||||
@@ -94,6 +104,7 @@ interface ChatStore {
|
||||
) => void;
|
||||
|
||||
getConfig: () => ChatConfig;
|
||||
resetConfig: () => void;
|
||||
updateConfig: (updater: (config: ChatConfig) => void) => void;
|
||||
}
|
||||
|
||||
@@ -103,11 +114,11 @@ export const useChatStore = create<ChatStore>()(
|
||||
sessions: [createEmptySession()],
|
||||
currentSessionIndex: 0,
|
||||
config: {
|
||||
historyMessageCount: 5,
|
||||
sendBotMessages: false as boolean,
|
||||
submitKey: SubmitKey.CtrlEnter as SubmitKey,
|
||||
avatar: "1fae0",
|
||||
theme: Theme.Auto as Theme,
|
||||
...DEFAULT_CONFIG,
|
||||
},
|
||||
|
||||
resetConfig() {
|
||||
set(() => ({ config: { ...DEFAULT_CONFIG } }));
|
||||
},
|
||||
|
||||
getConfig() {
|
||||
|
Reference in New Issue
Block a user