mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-01 21:14:43 -05:00
feat(gui): Preserve global state across page reloads (#48)
This commit is contained in:
parent
c7c7cf1886
commit
d913206062
5 changed files with 35 additions and 11 deletions
|
|
@ -1,14 +1,10 @@
|
|||
/**
|
||||
* TOOD: Perhaps we should move this to the `src-tauri` package.
|
||||
*/
|
||||
use crate::{monero, network::quote::BidQuote};
|
||||
use anyhow::Result;
|
||||
use bitcoin::Txid;
|
||||
use serde::Serialize;
|
||||
use typeshare::typeshare;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::{monero, network::quote::BidQuote};
|
||||
|
||||
static SWAP_PROGRESS_EVENT_NAME: &str = "swap-progress-update";
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
@ -29,8 +25,8 @@ impl TauriHandle {
|
|||
|
||||
#[allow(unused_variables)]
|
||||
pub fn emit_tauri_event<S: Serialize + Clone>(&self, event: &str, payload: S) -> Result<()> {
|
||||
#[cfg(tauri)]
|
||||
self.0.emit(event, payload).map_err(|e| e.into())?;
|
||||
#[cfg(feature = "tauri")]
|
||||
tauri::Emitter::emit(self.0.as_ref(), event, payload).map_err(anyhow::Error::from)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue