This commit is contained in:
Tony
2024-10-03 09:44:46 +08:00
parent 98d4fc4e9b
commit 8975d10bb7
5 changed files with 24 additions and 31 deletions
@@ -5,8 +5,6 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use std::time::Duration;
use serde_json::json;
use tauri::Listener;
use tauri_plugin_store::StoreExt;
@@ -19,13 +17,7 @@ fn main() {
.plugin(tauri_plugin_store::Builder::new().build())
.setup(|app| {
// Init store and load it from disk
let store = app
.handle()
.store_builder("settings.json")
.auto_save(Duration::from_millis(100))
.build()
.unwrap();
app.share_store(store.clone());
let store = app.handle().store_builder("settings.json").build().unwrap();
app.listen("store://change", |event| {
dbg!(event);
});