Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
mmrrnn committed Aug 5, 2024
1 parent f1b9bca commit d345347
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ mod process_adapter;
use crate::cpu_miner::CpuMiner;
use crate::mm_proxy_manager::MmProxyManager;
use crate::node_manager::NodeManager;
use log::{debug, error, info, warn};
use binary_resolver::{Binaries, BinaryResolver};
use log::{debug, error, info, warn};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use std::thread::sleep;
Expand All @@ -45,11 +45,14 @@ async fn setup_application<'r>(
state: tauri::State<'r, UniverseAppState>,
app: tauri::AppHandle,
) -> Result<(), String> {
drop(window.emit("message", SetupStatusEvent {
event_type: "setup_status".to_string(),
title: "Downloading Applications".to_string(),
progress: 0.5,
}));
drop(window.emit(
"message",
SetupStatusEvent {
event_type: "setup_status".to_string(),
title: "Downloading Applications".to_string(),
progress: 0.5,
},
));
state
.node_manager
.ensure_started(
Expand All @@ -58,11 +61,14 @@ async fn setup_application<'r>(
)
.await
.map_err(|e| e.to_string())?;
drop(window.emit("message", SetupStatusEvent {
event_type: "setup_status".to_string(),
title: "Syncing Blockchain".to_string(),
progress: 1.0,
}));
drop(window.emit(
"message",
SetupStatusEvent {
event_type: "setup_status".to_string(),
title: "Syncing Blockchain".to_string(),
progress: 1.0,
},
));
// TODO: Sync blockchain when p2p mining finished
thread::sleep(Duration::from_secs(5));
Ok(())
Expand Down Expand Up @@ -228,7 +234,12 @@ fn main() {

let app = tauri::Builder::default()
.manage(app_state)
.invoke_handler(tauri::generate_handler![setup_application, status, start_mining, stop_mining])
.invoke_handler(tauri::generate_handler![
setup_application,
status,
start_mining,
stop_mining
])
.build(tauri::generate_context!())
.expect("error while running tauri application");

Expand Down

0 comments on commit d345347

Please sign in to comment.