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