/ src / backend / storage.ts
storage.ts
 1  import Store from 'electron-store';
 2  
 3  export type SchemaType = {
 4    modelsPath: string;
 5  };
 6  
 7  const store = new Store<SchemaType>({
 8    defaults: {
 9      modelsPath: '',
10    },
11  });
12  
13  export const saveModelPathToStorage = (path: string) => {
14    store.set('modelsPath', path);
15  };
16  
17  export const getModelPathFromStorage = () => {
18    return store.get('modelsPath');
19  };
20  
21  export const clearStore = () => {
22    store.clear();
23  };