[fix] store persistence and switch dir to 'cstb'
This commit is contained in:
@@ -1,20 +1,15 @@
|
||||
// @ts-ignore
|
||||
// import path from "path"
|
||||
// import { appConfigDir } from "@tauri-apps/api/path"
|
||||
// import { setValtioPath } from "tauri-plugin-valtio"
|
||||
import { appConfigDir } from "@tauri-apps/api/path"
|
||||
import { setStoreCollectionPath } from "@tauri-store/valtio"
|
||||
import { appStore } from "./app"
|
||||
import { steamStore } from "./steam"
|
||||
import { toolStore } from "./tool"
|
||||
import path from "path"
|
||||
|
||||
// async function init() {
|
||||
// const configDir = await appConfigDir()
|
||||
// const distDir = path.join(configDir, "cstb")
|
||||
// await setValtioPath(distDir)
|
||||
// // console.log('init valtio', distDir);
|
||||
// }
|
||||
|
||||
// void init()
|
||||
|
||||
export const DEFAULT_STORE_CONFIG = {
|
||||
saveOnChange: true,
|
||||
saveOnExit: true,
|
||||
saveStrategy: "debounce" as const,
|
||||
saveInterval: 2000,
|
||||
export async function init() {
|
||||
await appStore.start()
|
||||
await toolStore.start()
|
||||
await steamStore.start()
|
||||
const appConfigDirPath = await appConfigDir()
|
||||
console.log(appConfigDirPath)
|
||||
await setStoreCollectionPath(path.resolve(appConfigDirPath, "cstb"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user