You've already forked AstralRinth
forked from didirus/AstralRinth
Fix deep linking / file open on mac (#2314)
* Fix deep linking / file open on mac * Update deep linking * fix build * fix build again * update workdir * try again * update conf path * try old conf * use in house tauri * move away from tauri GH act * add rpm support * Fix updater key * Fix signing key pass * fix ubuntu deps * Fix macos artifacts
This commit is contained in:
@@ -1,6 +1,28 @@
|
||||
use std::sync::Arc;
|
||||
use tauri::{Manager, Runtime};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct InitialPayload {
|
||||
pub payload: Arc<Mutex<Option<String>>>,
|
||||
}
|
||||
|
||||
pub fn get_or_init_payload<R: Runtime, M: Manager<R>>(
|
||||
manager: &M,
|
||||
) -> InitialPayload {
|
||||
let initial_payload = manager.try_state::<InitialPayload>();
|
||||
let mtx = if let Some(initial_payload) = initial_payload {
|
||||
initial_payload.inner().clone()
|
||||
} else {
|
||||
tracing::info!("No initial payload found, creating new");
|
||||
let payload = InitialPayload {
|
||||
payload: Arc::new(Mutex::new(None)),
|
||||
};
|
||||
|
||||
manager.manage(payload.clone());
|
||||
|
||||
payload
|
||||
};
|
||||
|
||||
mtx
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user