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 { fetch } from '@tauri-apps/plugin-http'
|
||||||
import { app } from '@tauri-apps/api'
|
import { app } from '@tauri-apps/api'
|
||||||
import LauncherManifest from '@/types/LauncherManifest'
|
import LauncherManifest from '@/types/LauncherManifest'
|
||||||
|
import {
|
||||||
|
isPermissionGranted,
|
||||||
|
requestPermission
|
||||||
|
} from '@tauri-apps/plugin-notification'
|
||||||
|
|
||||||
const roboto = Roboto({
|
const roboto = Roboto({
|
||||||
variable: '--font-roboto',
|
variable: '--font-roboto',
|
||||||
@@ -55,6 +59,8 @@ export default function RootLayout ({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(await isPermissionGranted())) await requestPermission()
|
||||||
|
|
||||||
setLoading(3)
|
setLoading(3)
|
||||||
})()
|
})()
|
||||||
}, [])
|
}, [])
|
||||||
|
|||||||
Reference in new issue
Block a user