From 13c5b684ec1f65abba98722d5cf9ec4f1ad3e132 Mon Sep 17 00:00:00 2001 From: David Llewellyn-Jones Date: Fri, 29 Apr 2022 22:35:52 +0300 Subject: [PATCH] Disable manual download buttons during checksum test After manually downloading a file, a checksum test is performed on the file. For large files this test can take some time (seconds), and there's currently no indication in the UI that this is taking place. This change disables the file selector and "Continue" buttons during the checksum test, changing the text in the button to "Checking..." instead. This provides immediate feedback for the user and avoids the confusion of allowing them to still use the buttons while the check is taking place. --- src/core/plugins/core/plugin.js | 2 ++ src/ui/views/ManualDownload.svelte | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/core/plugins/core/plugin.js b/src/core/plugins/core/plugin.js index 2e9f679f..f48bddfa 100644 --- a/src/core/plugins/core/plugin.js +++ b/src/core/plugins/core/plugin.js @@ -22,6 +22,7 @@ const fs = require("fs-extra"); const path = require("path"); const { download, checkFile } = require("progressive-downloader"); const { unpack } = require("../../helpers/asarLibs.js"); +const window = require("../../../lib/window.js"); /** * core plugin @@ -276,6 +277,7 @@ class CorePlugin extends Plugin { ) ) .then(ok => { + window.send("user:manual_download:check", ok); if (ok) { return ok; } else { diff --git a/src/ui/views/ManualDownload.svelte b/src/ui/views/ManualDownload.svelte index 1becc418..bfca7200 100644 --- a/src/ui/views/ManualDownload.svelte +++ b/src/ui/views/ManualDownload.svelte @@ -1,4 +1,5 @@