Make the download card visible, and the events arrive at all
Two separate faults, both hiding the same feature. The events never reached the shell. They were emitted from inside WebKit's download delegate, which runs on the main thread, and delivering an event means running JavaScript in a webview - which cannot happen from in there. They are now emitted from a spawned task, like every other event in the app that works. And the card was drawn over the page, where it could never be seen: an app's webview is a native view painted above everything the shell draws, so a card over the page is a card behind the page. It now lives in the nav, which is the shell's own - full detail when the nav is open, just the state icon on the rail. Verified end to end on a Gmail attachment: requested, named, saved, and shown as "Downloaded" with a Show button that reveals it.
This commit is contained in:
@@ -737,7 +737,8 @@ pub fn create(
|
||||
.unwrap()
|
||||
.insert(url.to_string(), (id, path.clone()));
|
||||
|
||||
let _ = dl_handle.emit(
|
||||
crate::downloads::announce(
|
||||
&dl_handle,
|
||||
"download-started",
|
||||
crate::downloads::DownloadStarted {
|
||||
id,
|
||||
@@ -755,7 +756,8 @@ pub fn create(
|
||||
let found = state.download_paths.lock().unwrap().remove(&url.to_string());
|
||||
if let Some((id, path)) = found {
|
||||
state.finished_downloads.lock().unwrap().insert(id);
|
||||
let _ = dl_handle.emit(
|
||||
crate::downloads::announce(
|
||||
&dl_handle,
|
||||
"download-finished",
|
||||
crate::downloads::DownloadFinished {
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user