jan/web/helpers/atoms/App.atom.ts
Faisal Amir 1c80cb2cd5
enhancement: default open Jan Input Box Settings and Right panel (#4234)
* enhancement: default open Jan Input Box Settings and Right panel

* chore: added option getOnInit atomstorage
2024-12-05 18:00:50 +07:00

26 lines
701 B
TypeScript

import { atom } from 'jotai'
import { atomWithStorage } from 'jotai/utils'
import { MainViewState } from '@/constants/screens'
export const mainViewStateAtom = atom<MainViewState>(MainViewState.Thread)
export const defaultJanDataFolderAtom = atom<string>('')
const SHOW_RIGHT_PANEL = 'showRightPanel'
// Store panel atom
export const showLeftPanelAtom = atom<boolean>(true)
export const showRightPanelAtom = atomWithStorage<boolean>(
SHOW_RIGHT_PANEL,
false,
undefined,
{ getOnInit: true }
)
export const showSystemMonitorPanelAtom = atom<boolean>(false)
export const appDownloadProgressAtom = atom<number>(-1)
export const updateVersionErrorAtom = atom<string | undefined>(undefined)