Skip to content

Commit

Permalink
Merge pull request #18267 from vector-im/t3chguy/fix/18266
Browse files Browse the repository at this point in the history
Dismiss electron download toast when clicking Open
  • Loading branch information
t3chguy authored Jul 29, 2021
2 parents 1d54312 + 1cffed2 commit ba5e690
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vector/platform/ElectronPlatform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ba5e690

Please sign in to comment.