mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-09 10:49:29 +00:00
fix(queue): harden resume failure and legacy controls
This commit is contained in:
@@ -420,6 +420,15 @@ impl DownloadStateEvent {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn paused_with_error(id: impl Into<String>, error: impl Into<String>) -> Self {
|
||||
Self {
|
||||
id: id.into(),
|
||||
status: DownloadStatus::Paused.as_str().to_string(),
|
||||
error: Some(error.into()),
|
||||
file_name: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn completed_with_file(id: impl Into<String>, file_name: impl Into<String>) -> Self {
|
||||
Self {
|
||||
id: id.into(),
|
||||
|
||||
@@ -4701,9 +4701,9 @@ async fn resume_download(
|
||||
);
|
||||
let _ = app_handle_clone.emit(
|
||||
"download-state",
|
||||
crate::ipc::DownloadStateEvent::new(
|
||||
crate::ipc::DownloadStateEvent::paused_with_error(
|
||||
&id_clone,
|
||||
crate::ipc::DownloadStatus::Paused,
|
||||
unpause_error,
|
||||
),
|
||||
);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user