Skip to content

Commit 723abab

Browse files
CasperSocioOrbisKautofix-ci[bot]
authored
docs(useWebNotification): add permission tip and update example (vueuse#4660)
Co-authored-by: Robin <robin.kehl@singular-it.de> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent ac72c11 commit 723abab

File tree

1 file changed

+6
-1
lines changed
  • packages/core/useWebNotification

1 file changed

+6
-1
lines changed

packages/core/useWebNotification/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ The Web Notification interface of the Notifications API is used to configure and
1010

1111
## Usage
1212

13+
::: tip
14+
Before an app can send a notification, the user must grant the application the right to do so. The user's OS settings may also prevent expected notification behaviour.
15+
:::
16+
1317
```ts
1418
const {
1519
isSupported,
1620
notification,
21+
permissionGranted,
1722
show,
1823
close,
1924
onClick,
@@ -28,7 +33,7 @@ const {
2833
tag: 'test',
2934
})
3035

31-
if (isSupported.value)
36+
if (isSupported.value && permissionGranted.value)
3237
show()
3338
```
3439

0 commit comments

Comments
 (0)