chore: fix typo
This commit is contained in:
parent
4c50ebfe0a
commit
ba4d1d3c12
@ -1,4 +1,4 @@
|
||||
export const localStoregeKey = {
|
||||
export const localStorageKey = {
|
||||
LeftPanel: 'left-panel',
|
||||
threads: 'threads',
|
||||
messages: 'messages',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
import { RgbaColor } from 'react-colorful'
|
||||
import { rgb, oklch, formatCss } from 'culori'
|
||||
import { useTheme } from './useTheme'
|
||||
@ -533,7 +533,7 @@ export const useAppearance = create<AppearanceState>()(
|
||||
}
|
||||
},
|
||||
{
|
||||
name: localStoregeKey.settingAppearance,
|
||||
name: localStorageKey.settingAppearance,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
// Apply settings when hydrating from storage
|
||||
onRehydrateStorage: () => (state) => {
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
import { create } from 'zustand'
|
||||
import { persist } from 'zustand/middleware'
|
||||
|
||||
|
||||
interface AssistantState {
|
||||
assistants: Assistant[]
|
||||
currentAssistant: Assistant
|
||||
@ -42,7 +41,7 @@ export const useAssistant = create<AssistantState>()(
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: localStoregeKey.assistant,
|
||||
name: localStorageKey.assistant,
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
|
||||
export type CodeBlockStyle = string
|
||||
|
||||
@ -39,7 +39,7 @@ export const useCodeblock = create<CodeBlockState>()(
|
||||
}
|
||||
},
|
||||
{
|
||||
name: localStoregeKey.settingCodeBlock,
|
||||
name: localStorageKey.settingCodeBlock,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
|
||||
type LeftPanelStoreState = {
|
||||
// @ts-ignore
|
||||
@ -20,7 +20,7 @@ export const useGeneralSetting = create<LeftPanelStoreState>()(
|
||||
setCurrentLanguage: (value) => set({ currentLanguage: value }),
|
||||
}),
|
||||
{
|
||||
name: localStoregeKey.settingGeneral,
|
||||
name: localStorageKey.settingGeneral,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
|
||||
// Hardware data types
|
||||
export interface CPU {
|
||||
@ -210,7 +210,7 @@ export const useHardware = create<HardwareStore>()(
|
||||
}),
|
||||
}),
|
||||
{
|
||||
name: localStoregeKey.settingHardware,
|
||||
name: localStorageKey.settingHardware,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
|
||||
type LeftPanelStoreState = {
|
||||
open: boolean
|
||||
@ -14,7 +14,7 @@ export const useLeftPanel = create<LeftPanelStoreState>()(
|
||||
setLeftPanel: (value) => set({ open: value }),
|
||||
}),
|
||||
{
|
||||
name: localStoregeKey.LeftPanel,
|
||||
name: localStorageKey.LeftPanel,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
|
||||
type LocalApiServerState = {
|
||||
// Run local API server once app opens
|
||||
@ -40,7 +40,7 @@ export const useLocalApiServer = create<LocalApiServerState>()(
|
||||
setVerboseLogs: (value) => set({ verboseLogs: value }),
|
||||
}),
|
||||
{
|
||||
name: localStoregeKey.settingLocalApiServer,
|
||||
name: localStorageKey.settingLocalApiServer,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
import { updateMCPConfig } from '@/services/mcp'
|
||||
|
||||
// Define the structure of an MCP server configuration
|
||||
@ -77,7 +77,7 @@ export const useMCPServers = create<MCPServerStoreState>()(
|
||||
}),
|
||||
}),
|
||||
{
|
||||
name: localStoregeKey.settingMCPSevers, // Using existing key for now
|
||||
name: localStorageKey.settingMCPSevers, // Using existing key for now
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { create } from 'zustand'
|
||||
import { ThreadMessage } from '@janhq/core'
|
||||
import { createJSONStorage, persist } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
import {
|
||||
createMessage,
|
||||
deleteMessage as deleteMessageExt,
|
||||
@ -57,7 +57,7 @@ export const useMessages = create<MessageState>()(
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: localStoregeKey.messages,
|
||||
name: localStorageKey.messages,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
|
||||
type ModelProviderState = {
|
||||
providers: ModelProvider[]
|
||||
@ -116,7 +116,7 @@ export const useModelProvider = create<ModelProviderState>()(
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: localStoregeKey.modelProvider,
|
||||
name: localStorageKey.modelProvider,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
|
||||
type ProxyConfigState = {
|
||||
proxyEnabled: boolean
|
||||
@ -52,7 +52,7 @@ export const useProxyConfig = create<ProxyConfigState>()(
|
||||
setNoProxy: (noProxy) => set({ noProxy }),
|
||||
}),
|
||||
{
|
||||
name: localStoregeKey.settingLocalApiServer,
|
||||
name: localStorageKey.settingLocalApiServer,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { create } from 'zustand'
|
||||
import { createJSONStorage, persist } from 'zustand/middleware'
|
||||
import { getCurrentWindow, Theme } from '@tauri-apps/api/window'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
|
||||
// Function to check if OS prefers dark mode
|
||||
export const checkOSDarkMode = (): boolean => {
|
||||
@ -48,7 +48,7 @@ export const useTheme = create<ThemeState>()(
|
||||
return initialState
|
||||
},
|
||||
{
|
||||
name: localStoregeKey.theme,
|
||||
name: localStorageKey.theme,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
import { ulid } from 'ulidx'
|
||||
import { createThread, deleteThread, updateThread } from '@/services/threads'
|
||||
import Fuse from 'fuse.js'
|
||||
@ -247,7 +247,7 @@ export const useThreads = create<ThreadState>()(
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: localStoregeKey.threads,
|
||||
name: localStorageKey.threads,
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
|
||||
@ -11,9 +11,9 @@ import enSettings from '@/locales/en/settings.json'
|
||||
import idSettings from '@/locales/id/settings.json'
|
||||
import vnSettings from '@/locales/vn/settings.json'
|
||||
|
||||
import { localStoregeKey } from '@/constants/localStorage'
|
||||
import { localStorageKey } from '@/constants/localStorage'
|
||||
|
||||
const stored = localStorage.getItem(localStoregeKey.settingGeneral)
|
||||
const stored = localStorage.getItem(localStorageKey.settingGeneral)
|
||||
const parsed = stored ? JSON.parse(stored) : {}
|
||||
const defaultLang = parsed?.state?.currentLanguage
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user