add options for marking single notification as read
This commit is contained in:
parent
c059f4a7ee
commit
ec2937ec1f
11 changed files with 85 additions and 4 deletions
|
|
@ -66,6 +66,12 @@ self.addEventListener('message', async (event) => {
|
|||
self.registration.showNotification(title, rest)
|
||||
}
|
||||
|
||||
if (type === 'desktopNotificationClose') {
|
||||
const { id, all } = content
|
||||
const search = all ? null : { tag: id }
|
||||
self.registration.getNotifications(search).forEach(n => n.close())
|
||||
}
|
||||
|
||||
if (type === 'updateFocus') {
|
||||
state.lastFocused = event.source.id
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue