[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:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user