aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-08-27 23:55:33 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-08-27 23:55:33 +0200
commit74e8d7f5104b08d1598693602979b29cfcd146e9 (patch)
tree466aa853a54567ff3a290f4d6105a49a0abcf4a2 /src-tauri/src
parent2ce6e6a8767e23b429a33034c9dea143b0e65f22 (diff)
downloadFlightCore-74e8d7f5104b08d1598693602979b29cfcd146e9.tar.gz
FlightCore-74e8d7f5104b08d1598693602979b29cfcd146e9.zip
Show version number in UI
Diffstat (limited to 'src-tauri/src')
-rw-r--r--src-tauri/src/main.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 9f1229f7..cbf10065 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -50,6 +50,21 @@ fn main() {
}
});
+ let app_handle = app.app_handle();
+ tauri::async_runtime::spawn(async move {
+ // Sending current version inside a timed loop is a bad idea as it shouldn't change at runtime
+ // The reason this is currently done like this is cause I haven't figure out yet how to just send it once / read it in front-end
+ let version = env!("CARGO_PKG_VERSION");
+ loop {
+ sleep(Duration::from_millis(1000)).await;
+ println!("sending install location");
+ println!("{}", version);
+ app_handle
+ .emit_all("current-version-ping", version)
+ .unwrap();
+ }
+ });
+
Ok(())
})
.manage(Counter(Default::default()))