浏览代码

badge count sentry error

Viktoriia 12 小时之前
父节点
当前提交
db400a2c8f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/contexts/PushNotificationContext.tsx

+ 2 - 2
src/contexts/PushNotificationContext.tsx

@@ -45,7 +45,7 @@ export const PushNotificationProvider = ({ children }: { children: React.ReactNo
       if (appState.match(/inactive|background/) && nextAppState === 'active' && isSubscribed) {
       if (appState.match(/inactive|background/) && nextAppState === 'active' && isSubscribed) {
         Notifications.getBadgeCountAsync().then((badgeCount) => {
         Notifications.getBadgeCountAsync().then((badgeCount) => {
           if (badgeCount > 0) {
           if (badgeCount > 0) {
-            Notifications.setBadgeCountAsync(-1);
+            Notifications.setBadgeCountAsync(0);
           }
           }
         });
         });
         Notifications.getPresentedNotificationsAsync().then((notifications) => {
         Notifications.getPresentedNotificationsAsync().then((notifications) => {
@@ -284,7 +284,7 @@ export const PushNotificationProvider = ({ children }: { children: React.ReactNo
 
 
       Notifications.getBadgeCountAsync().then((badgeCount) => {
       Notifications.getBadgeCountAsync().then((badgeCount) => {
         if (badgeCount > 0) {
         if (badgeCount > 0) {
-          Notifications.setBadgeCountAsync(-1);
+          Notifications.setBadgeCountAsync(0);
         }
         }
       });
       });