From 1cffed2336a4f77b73ddc9eaede0970abbdb8e7a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 27 Jul 2021 15:04:55 +0100 Subject: [PATCH] Dismiss electron download toast when clicking Open --- src/vector/platform/ElectronPlatform.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index c97b7dc922..dfec829d10 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -257,12 +257,15 @@ export default class ElectronPlatform extends VectorBasePlatform { }); electron.on('userDownloadCompleted', (ev, { path, name }) => { + const key = `DOWNLOAD_TOAST_${path}`; + const onAccept = () => { electron.send('userDownloadOpen', { path }); + ToastStore.sharedInstance().dismissToast(key); }; ToastStore.sharedInstance().addOrReplaceToast({ - key: `DOWNLOAD_TOAST_${path}`, + key, title: _t("Download Completed"), props: { description: name,