mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-20 23:54:46 +00:00
desktop: add electron version (#15663)
This commit is contained in:
15
packages/desktop-electron/src/main/store.ts
Normal file
15
packages/desktop-electron/src/main/store.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import Store from "electron-store"
|
||||
|
||||
import { SETTINGS_STORE } from "./constants"
|
||||
|
||||
const cache = new Map<string, Store>()
|
||||
|
||||
export function getStore(name = SETTINGS_STORE) {
|
||||
const cached = cache.get(name)
|
||||
if (cached) return cached
|
||||
const next = new Store({ name })
|
||||
cache.set(name, next)
|
||||
return next
|
||||
}
|
||||
|
||||
export const store = getStore(SETTINGS_STORE)
|
||||
Reference in New Issue
Block a user