mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-13 00:02:41 +10:00
fix(downloads): Fix rearranging download queue throwing error
This commit is contained in:
@ -167,7 +167,7 @@ function loadGamesForQueue(v: typeof queue.value) {
|
|||||||
loadGamesForQueue(queue.value);
|
loadGamesForQueue(queue.value);
|
||||||
|
|
||||||
async function onEnd(event: { oldIndex: number; newIndex: number }) {
|
async function onEnd(event: { oldIndex: number; newIndex: number }) {
|
||||||
await invoke("move_game_in_queue", {
|
await invoke("move_download_in_queue", {
|
||||||
oldIndex: event.oldIndex,
|
oldIndex: event.oldIndex,
|
||||||
newIndex: event.newIndex,
|
newIndex: event.newIndex,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -167,6 +167,10 @@ impl DownloadManager {
|
|||||||
self.command_sender
|
self.command_sender
|
||||||
.send(DownloadManagerSignal::UpdateUIQueue)
|
.send(DownloadManagerSignal::UpdateUIQueue)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
self.command_sender
|
||||||
|
.send(DownloadManagerSignal::Go)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
}
|
}
|
||||||
pub fn pause_downloads(&self) {
|
pub fn pause_downloads(&self) {
|
||||||
self.command_sender
|
self.command_sender
|
||||||
|
|||||||
@ -209,11 +209,13 @@ impl DownloadManagerBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if self.current_download_agent.is_some() {
|
if self.current_download_agent.is_some() {
|
||||||
debug!(
|
if self.download_queue.read().front().unwrap() == &self.current_download_agent.as_ref().unwrap().metadata() {
|
||||||
"Current download agent: {:?}",
|
debug!(
|
||||||
self.current_download_agent.as_ref().unwrap().metadata()
|
"Current download agent: {:?}",
|
||||||
);
|
self.current_download_agent.as_ref().unwrap().metadata()
|
||||||
return;
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("current download queue: {:?}", self.download_queue.read());
|
debug!("current download queue: {:?}", self.download_queue.read());
|
||||||
|
|||||||
Reference in New Issue
Block a user