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
|
|
@ -96,6 +96,15 @@ export async function showDesktopNotification (content) {
|
|||
sw.postMessage({ type: 'desktopNotification', content })
|
||||
}
|
||||
|
||||
export async function closeDesktopNotification ({ id }) {
|
||||
const { active: sw } = await window.navigator.serviceWorker.getRegistration()
|
||||
if (id >= 0) {
|
||||
sw.postMessage({ type: 'desktopNotificationClose', content: { id } })
|
||||
} else {
|
||||
sw.postMessage({ type: 'desktopNotificationClose', content: { all: true } })
|
||||
}
|
||||
}
|
||||
|
||||
export async function updateFocus () {
|
||||
const { active: sw } = await window.navigator.serviceWorker.getRegistration()
|
||||
sw.postMessage({ type: 'updateFocus' })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue