[fix] store not saving due to dep, reset to default dir

note: changing path or start() in useEffect cause the issue
This commit is contained in:
Purp1e
2025-03-13 02:34:59 +08:00
parent 06e6c5c3eb
commit bfcf519894
6 changed files with 20 additions and 21 deletions

View File

@@ -1,20 +1,20 @@
// @ts-ignore
import path from "path"
import { appConfigDir } from "@tauri-apps/api/path"
import { setValtioPath } from "tauri-plugin-valtio"
// import path from "path"
// import { appConfigDir } from "@tauri-apps/api/path"
// import { setValtioPath } from "tauri-plugin-valtio"
async function init() {
const configDir = await appConfigDir()
const distDir = path.join(configDir, "cstb")
await setValtioPath(distDir)
// console.log('init valtio', distDir);
}
// async function init() {
// const configDir = await appConfigDir()
// const distDir = path.join(configDir, "cstb")
// await setValtioPath(distDir)
// // console.log('init valtio', distDir);
// }
void init()
// void init()
export const DEFAULT_STORE_CONFIG = {
saveOnChange: true,
saveOnExit: true,
saveStrategy: "debounce" as const,
saveInterval: 3000,
saveInterval: 2000,
}