[Glitch] Converted app/javascript/flavours/glitch/utils/ folder to TypeScript
Port 1142f4c79e to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
1 parent
52c023a305
commit
695dcc6ca8
10 files changed
+77
-75
No files matched your search
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Tries Notification.requestPermission, console warning instead of rejecting on error.
|
||||
* @param callback Runs with the permission result on completion.
|
||||
*/
|
||||
export const requestNotificationPermission = async (
|
||||
callback: NotificationPermissionCallback,
|
||||
) => {
|
||||
try {
|
||||
callback(await Notification.requestPermission());
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user