Skip to content

Commit

Permalink
fix: buggy state fetch (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
swarnimarun authored and tiero committed Nov 2, 2023
1 parent 6c23152 commit 1fd614c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src-tauri/src/download.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::errors::{Context, Result};
use std::collections::HashMap;
use std::sync::Arc;

use crate::{err, utils, SharedState};
use futures::StreamExt;
Expand Down Expand Up @@ -144,7 +145,7 @@ impl<R: Runtime> Downloader<R> {
total_file_size: u64,
size_on_disk: u64,
) -> Result<()> {
let state = self.window.state::<SharedState>();
let state = self.window.state::<Arc<SharedState>>();
let mut downloading_files_guard = state.downloading_files.lock().await;
if downloading_files_guard.contains(&output_path.as_ref().to_string()) {
log::warn!("File already downloading: {}", output_path.as_ref());
Expand Down

0 comments on commit 1fd614c

Please sign in to comment.