Request notification permission on start
This commit is contained in:
1 file changed
+6
@@ -9,6 +9,10 @@ import { useEffect, useState } from 'react'
|
||||
import { fetch } from '@tauri-apps/plugin-http'
|
||||
import { app } from '@tauri-apps/api'
|
||||
import LauncherManifest from '@/types/LauncherManifest'
|
||||
import {
|
||||
isPermissionGranted,
|
||||
requestPermission
|
||||
} from '@tauri-apps/plugin-notification'
|
||||
|
||||
const roboto = Roboto({
|
||||
variable: '--font-roboto',
|
||||
@@ -55,6 +59,8 @@ export default function RootLayout ({
|
||||
return
|
||||
}
|
||||
|
||||
if (!(await isPermissionGranted())) await requestPermission()
|
||||
|
||||
setLoading(3)
|
||||
})()
|
||||
}, [])
|
||||
|
||||
Reference in new issue
Block a user