chore: version info modal
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
import { atom } from 'jotai';
|
||||
import { atomWithStorage } from 'jotai/utils';
|
||||
|
||||
export const userAtom = atomWithStorage<any>('userInfo', null);
|
||||
|
||||
export const GPUStackVersionAtom = atom<{
|
||||
version: string;
|
||||
git_commit: string;
|
||||
}>({
|
||||
version: '',
|
||||
git_commit: ''
|
||||
});
|
||||
|
||||
export const initialPasswordAtom = atomWithStorage<string>(
|
||||
'initialPassword',
|
||||
''
|
||||
|
||||
@@ -8,7 +8,14 @@ export const clearAtomStorage = (atom: any) => {
|
||||
store.set(atom, null);
|
||||
};
|
||||
|
||||
export const getAtomStorage = (atom: any) => {
|
||||
export const setAtomStorage = (atom: any, value: any) => {
|
||||
if (!atom) {
|
||||
return;
|
||||
}
|
||||
const store = getDefaultStore();
|
||||
store.set(atom, value);
|
||||
};
|
||||
export const getAtomStorage = (atom: any): any => {
|
||||
if (!atom) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user