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
This commit is contained in:
parent
41e0d4cddc
commit
1c80cb2cd5
@ -11,15 +11,14 @@ const Responsive = () => {
|
||||
const [showRightPanel, setShowRightPanel] = useAtom(showRightPanelAtom)
|
||||
|
||||
// Refs to store the last known state of the panels
|
||||
const lastLeftPanelState = useRef<boolean>(true)
|
||||
const lastRightPanelState = useRef<boolean>(true)
|
||||
const lastLeftPanelState = useRef<boolean>(showLeftPanel)
|
||||
const lastRightPanelState = useRef<boolean>(showRightPanel)
|
||||
|
||||
useEffect(() => {
|
||||
if (matches) {
|
||||
// Store the last known state before closing the panels
|
||||
lastLeftPanelState.current = showLeftPanel
|
||||
lastRightPanelState.current = showRightPanel
|
||||
|
||||
setShowLeftPanel(false)
|
||||
setShowRightPanel(false)
|
||||
} else {
|
||||
|
||||
@ -1,14 +1,25 @@
|
||||
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 = 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)
|
||||
|
||||
@ -207,7 +207,7 @@ export const setThreadModelParamsAtom = atom(
|
||||
*/
|
||||
export const activeSettingInputBoxAtom = atomWithStorage<boolean>(
|
||||
ACTIVE_SETTING_INPUT_BOX,
|
||||
false,
|
||||
true,
|
||||
undefined,
|
||||
{ getOnInit: true }
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user