Skip to content

Commit

Permalink
fix: Don't exceed 100% of progress on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Xtr126 authored Oct 24, 2024
1 parent 38e8597 commit 001b6f1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,19 @@ fn start_install(

let window_ = window.clone();

// We cant determine progress on windows by checking size
// We can't determine progress on windows by checking size
#[cfg(windows)]
thread::spawn(move || {
let mut progress = 1;
loop {
progress = progress + 1;
// 100 should be sent only from the other thread
if progress != 100 { window.emit("new-dir-size", progress).unwrap(); }
thread::sleep(time::Duration::from_secs(1));
if progress != 100 {
window.emit("new-dir-size", progress).unwrap();
thread::sleep(time::Duration::from_secs(1));
} else {
break;
}
}
});

Expand Down

0 comments on commit 001b6f1

Please sign in to comment.