feat(ags notifs): add blocked apps list
This commit is contained in:
parent
bbf96b34c5
commit
d5a9b24de1
3 changed files with 107 additions and 89 deletions
|
@ -73,7 +73,17 @@ const NotificationIcon = ({ appEntry, appIcon, image }) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ({ id, summary, body, actions, urgency, time, command = i => {}, ...icon }) => Draggable({
|
export default ({ id, summary, body, actions, urgency, time, command = i => {}, ...icon }) => {
|
||||||
|
const BlockedApps = [
|
||||||
|
'Spotify',
|
||||||
|
];
|
||||||
|
|
||||||
|
if (BlockedApps.find(app => app == Notifications.getNotification(id).appName)) {
|
||||||
|
Notifications.close(id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Draggable({
|
||||||
maxOffset: 200,
|
maxOffset: 200,
|
||||||
command: () => command(id),
|
command: () => command(id),
|
||||||
properties: [
|
properties: [
|
||||||
|
@ -162,4 +172,5 @@ export default ({ id, summary, body, actions, urgency, time, command = i => {},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
|
@ -61,12 +61,16 @@ const NotificationList = () => Box({
|
||||||
.map(n => Notification({ ...n, command: i => Notifications.close(i), }));
|
.map(n => Notification({ ...n, command: i => Notifications.close(i), }));
|
||||||
}
|
}
|
||||||
else if (id) {
|
else if (id) {
|
||||||
box.add(Notification({
|
const NewNotif = Notification({
|
||||||
...Notifications.getNotification(id),
|
...Notifications.getNotification(id),
|
||||||
command: i => Notifications.close(i),
|
command: i => Notifications.close(i),
|
||||||
}));
|
});
|
||||||
|
|
||||||
|
if (NewNotif) {
|
||||||
|
box.add(NewNotif);
|
||||||
box.show_all();
|
box.show_all();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}, 'notified'],
|
}, 'notified'],
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@ const Popups = () => Box({
|
||||||
if (!id || Notifications.dnd)
|
if (!id || Notifications.dnd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (! Notifications.getNotification(id))
|
||||||
|
return;
|
||||||
|
|
||||||
box._map.delete(id);
|
box._map.delete(id);
|
||||||
|
|
||||||
box._map.set(id, Notification({
|
box._map.set(id, Notification({
|
||||||
|
|
Loading…
Reference in a new issue