浏览代码

unsubscribe fix

Viktoriia 9 月之前
父节点
当前提交
1e410d3a87
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      src/contexts/PushNotificationContext.tsx

+ 4 - 5
src/contexts/PushNotificationContext.tsx

@@ -211,10 +211,7 @@ export const PushNotificationProvider = ({ children }: { children: React.ReactNo
 
   const unsubscribeFromNotifications = async () => {
     const settings = {
-      'app-ios': 0,
-      'app-android': 0,
-      'app-friends': 0,
-      'email-friends': 0
+      [Platform.OS === 'ios' ? 'app-ios' : 'app-android']: 0
     };
 
     await setNotificationsSettings({
@@ -236,7 +233,9 @@ export const PushNotificationProvider = ({ children }: { children: React.ReactNo
   };
 
   return (
-    <PushNotificationContext.Provider value={{ isSubscribed, toggleSubscription, unsubscribeFromNotifications }}>
+    <PushNotificationContext.Provider
+      value={{ isSubscribed, toggleSubscription, unsubscribeFromNotifications }}
+    >
       {children}
     </PushNotificationContext.Provider>
   );