mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-01 11:06:13 -04:00
feat(cli+tauri): Send logs from host to guest (#90)
* feat(tauri): send logs from cli to tauri --------- Co-authored-by: binarybaron <binarybaron@unstoppableswap.net> Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
This commit is contained in:
parent
21608ce4f7
commit
7b79ad6abe
14 changed files with 206 additions and 136 deletions
|
@ -138,15 +138,12 @@ fn setup(app: &mut tauri::App) -> Result<(), Box<dyn std::error::Error>> {
|
|||
match context {
|
||||
Ok(context) => {
|
||||
let state = app_handle.state::<RwLock<State>>();
|
||||
|
||||
state.write().await.set_context(Arc::new(context));
|
||||
|
||||
// To display to the user that the setup is done, we emit an event to the Tauri frontend
|
||||
tauri_handle.emit_context_init_progress_event(TauriContextStatusEvent::Available);
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Error while initializing context: {:?}", e);
|
||||
|
||||
// To display to the user that the setup failed, we emit an event to the Tauri frontend
|
||||
tauri_handle.emit_context_init_progress_event(TauriContextStatusEvent::Failed);
|
||||
}
|
||||
|
@ -182,7 +179,8 @@ pub fn run() {
|
|||
RunEvent::Exit | RunEvent::ExitRequested { .. } => {
|
||||
// Here we cleanup the Context when the application is closed
|
||||
// This is necessary to among other things stop the monero-wallet-rpc process
|
||||
// If the application is forcibly closed, this may not be called
|
||||
// If the application is forcibly closed, this may not be called.
|
||||
// TODO: fix that
|
||||
let context = app.state::<RwLock<State>>().inner().try_read();
|
||||
|
||||
match context {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue