Add version number to settings page
This commit is contained in:
10 files changed
+100
-66
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import {
|
||||
isPermissionGranted,
|
||||
requestPermission,
|
||||
sendNotification
|
||||
} from '@tauri-apps/plugin-notification'
|
||||
|
||||
export async function notifyUser (title: string, body: string) {
|
||||
let permissionGranted = await isPermissionGranted()
|
||||
if (!permissionGranted) {
|
||||
const permission = await requestPermission()
|
||||
permissionGranted = permission === 'granted'
|
||||
}
|
||||
|
||||
if (permissionGranted) {
|
||||
sendNotification({ title, body })
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user