aboutsummaryrefslogtreecommitdiff
path: root/src-tauri
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-20 21:10:34 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-20 21:10:34 +0200
commitcc82d961fc0d4d80e0f44857fe2b462c5108fa9a (patch)
treedcc4bad5d2995946861074f2416dedb777a4ee86 /src-tauri
parent6553d959f0a0504a1f13c116f11bfe0116d8ff63 (diff)
downloadFlightCore-cc82d961fc0d4d80e0f44857fe2b462c5108fa9a.tar.gz
FlightCore-cc82d961fc0d4d80e0f44857fe2b462c5108fa9a.zip
Make button to select NS RC persistent
Uses a tauri plugin for persistent store behind the scenes to persist values over restarts of the application.
Diffstat (limited to 'src-tauri')
-rw-r--r--src-tauri/Cargo.lock13
-rw-r--r--src-tauri/Cargo.toml2
-rw-r--r--src-tauri/src/main.rs2
3 files changed, 17 insertions, 0 deletions
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 1ef32cb6..d78828eb 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -90,6 +90,7 @@ dependencies = [
"sysinfo",
"tauri",
"tauri-build",
+ "tauri-plugin-store",
"tokio",
"zip",
]
@@ -3467,6 +3468,18 @@ dependencies = [
]
[[package]]
+name = "tauri-plugin-store"
+version = "0.0.0"
+source = "git+https://github.com/tauri-apps/tauri-plugin-store?branch=dev#d8efb964bb1894bdf01407693ee896d0f9c557b3"
+dependencies = [
+ "log",
+ "serde",
+ "serde_json",
+ "tauri",
+ "thiserror",
+]
+
+[[package]]
name = "tauri-runtime"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 1c077992..0dc2873e 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -36,6 +36,8 @@ regex = "1.6.0"
sysinfo = "0.26.2"
# HTTP requests
reqwest = { version = "0.11", features = ["blocking"] }
+# Persistent store for settings
+tauri-plugin-store = { git = "https://github.com/tauri-apps/tauri-plugin-store", branch = "dev" }
[features]
# by default Tauri runs in production mode
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index c6c51e2b..492c5935 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -16,6 +16,7 @@ use app::{
};
use tauri::{Manager, State};
use tokio::time::sleep;
+use tauri_plugin_store::PluginBuilder;
#[derive(Default)]
struct Counter(Arc<Mutex<i32>>);
@@ -32,6 +33,7 @@ fn main() {
));
tauri::Builder::default()
+ .plugin(PluginBuilder::default().build())
.setup(|app| {
let app_handle = app.app_handle();
tauri::async_runtime::spawn(async move {