2024-02-25 00:22:59 -08:00
|
|
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
|
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
|
|
|
|
2024-02-27 22:54:06 -08:00
|
|
|
use tauri::Manager;
|
|
|
|
mod telemetry;
|
|
|
|
|
|
|
|
#[derive(Clone, serde::Serialize)]
|
|
|
|
struct Payload {
|
|
|
|
message: String,
|
|
|
|
}
|
|
|
|
|
2024-02-25 00:22:59 -08:00
|
|
|
fn main() {
|
2024-02-28 21:43:18 -08:00
|
|
|
let rt = tokio::runtime::Runtime::new().expect("Failed to create Tokio runtime");
|
|
|
|
|
|
|
|
rt.block_on(async {
|
|
|
|
tauri::Builder::default()
|
|
|
|
.setup(|app| {
|
|
|
|
// create app handle and send it to our event listeners
|
|
|
|
let app_handle = app.app_handle();
|
|
|
|
|
|
|
|
tokio::spawn(async move {
|
|
|
|
crate::telemetry::subscribe_topics(app_handle.clone()).await;
|
|
|
|
});
|
2024-02-27 22:54:06 -08:00
|
|
|
|
2024-02-28 21:43:18 -08:00
|
|
|
Ok(())
|
|
|
|
})
|
|
|
|
.run(tauri::generate_context!())
|
|
|
|
.expect("failed to run app")
|
|
|
|
})
|
2024-02-25 00:22:59 -08:00
|
|
|
}
|