Merge pull request #18267 from vector-im/t3chguy/fix/18266

Dismiss electron download toast when clicking Open
This commit is contained in:
Michael Telatynski 2021-07-29 16:11:46 +01:00 committed by GitHub
commit ba5e690a38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,