File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,17 @@ export class PermissionUtils {
1414 if ( PermissionUtils . executing ) {
1515 return ;
1616 }
17+
1718 PermissionUtils . executing = true ;
19+ try {
20+ await PermissionUtils . privateTriggerNotificationPermissionChanged ( updateIfIdentical ) ;
21+ }
22+ finally {
23+ PermissionUtils . executing = false ;
24+ }
25+ }
1826
27+ private static async privateTriggerNotificationPermissionChanged ( updateIfIdentical : boolean ) {
1928 const newPermission = await OneSignal . privateGetNotificationPermission ( ) ;
2029 const previousPermission = await Database . get ( 'Options' , 'notificationPermission' ) ;
2130
@@ -26,6 +35,5 @@ export class PermissionUtils {
2635
2736 await Database . put ( 'Options' , { key : 'notificationPermission' , value : newPermission } ) ;
2837 Event . trigger ( OneSignal . EVENTS . NATIVE_PROMPT_PERMISSIONCHANGED , { to : newPermission } ) ;
29- PermissionUtils . executing = false ;
3038 }
3139}
You can’t perform that action at this time.
0 commit comments