mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
fix: notification closing
This commit is contained in:
@ -29,8 +29,6 @@ export default (
|
||||
const sendNotification = (songInfo: SongInfo) => {
|
||||
const iconSrc = notificationImage(songInfo, config());
|
||||
|
||||
savedNotification?.close();
|
||||
|
||||
let icon: string;
|
||||
if (typeof iconSrc === 'object') {
|
||||
icon = iconSrc.toDataURL();
|
||||
@ -50,6 +48,9 @@ export default (
|
||||
toastXml: getXml(songInfo, icon),
|
||||
});
|
||||
|
||||
// To fix the notification not closing
|
||||
setTimeout(() => savedNotification?.close(), 5000);
|
||||
|
||||
savedNotification.on('close', () => {
|
||||
savedNotification = undefined;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user