Skip to content

Commit afa6454

Browse files
fix: Notification Types for download cancelled & completed added. (#2485)
1 parent 862b493 commit afa6454

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/downloads/main.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,14 @@ export const handleWillDownloadEvent = async (
9797
});
9898
});
9999

100-
item.on('done', () => {
100+
item.on('done', (_event, state) => {
101101
createNotification({
102102
title: 'Downloads',
103103
body: item.getFilename(),
104-
subtitle: t('downloads.notifications.downloadFinished'),
104+
subtitle:
105+
state === 'completed'
106+
? t('downloads.notifications.downloadFinished')
107+
: t('downloads.notifications.downloadCancelled'),
105108
});
106109

107110
dispatch({

src/i18n/en.i18n.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@
114114
"downloads": {
115115
"title": "Downloads",
116116
"notifications": {
117-
"downloadFinished": "Download finished"
117+
"downloadFinished": "Download Finished",
118+
"downloadInterrupted": "Download Interrupted",
119+
"downloadCancelled": "Download Cancelled",
120+
"downloadFailed": "Download could not be completed"
118121
},
119122
"filters": {
120123
"search": "Search",

0 commit comments

Comments
 (0)