Viktoriia 9 месяцев назад
Родитель
Сommit
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 unsubscribeFromNotifications = async () => {
     const settings = {
     const settings = {
-      'app-ios': 0,
-      'app-android': 0,
-      'app-friends': 0,
-      'email-friends': 0
+      [Platform.OS === 'ios' ? 'app-ios' : 'app-android']: 0
     };
     };
 
 
     await setNotificationsSettings({
     await setNotificationsSettings({
@@ -236,7 +233,9 @@ export const PushNotificationProvider = ({ children }: { children: React.ReactNo
   };
   };
 
 
   return (
   return (
-    <PushNotificationContext.Provider value={{ isSubscribed, toggleSubscription, unsubscribeFromNotifications }}>
+    <PushNotificationContext.Provider
+      value={{ isSubscribed, toggleSubscription, unsubscribeFromNotifications }}
+    >
       {children}
       {children}
     </PushNotificationContext.Provider>
     </PushNotificationContext.Provider>
   );
   );