From 4864f6cd5c1c4a4c0a41fd19a7e9666103aabd72 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Thu, 9 Feb 2023 14:11:54 +0100 Subject: [PATCH] Fix #701 --- src/screens/Tabs/Me/Push.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/screens/Tabs/Me/Push.tsx b/src/screens/Tabs/Me/Push.tsx index 3fdf1fe7..727e0998 100644 --- a/src/screens/Tabs/Me/Push.tsx +++ b/src/screens/Tabs/Me/Push.tsx @@ -164,11 +164,10 @@ const TabMePush: React.FC = () => { url: `push/unsubscribe/${pushPath}` }) + setAccountStorage([{ key: 'push', value: { ...push, global: false } }]) if (Platform.OS === 'android') { Notifications.deleteNotificationChannelGroupAsync(accountFull) } - - setAccountStorage([{ key: 'push', value: { ...push, global: false } }]) } else { // Fix a bug for some users of v4.8.0 let authKey = push.key @@ -182,7 +181,7 @@ const TabMePush: React.FC = () => { const body: { subscription: any - alerts: Mastodon.PushSubscription['alerts'] + data: { alerts: Mastodon.PushSubscription['alerts'] } } = { subscription: { endpoint, @@ -192,7 +191,7 @@ const TabMePush: React.FC = () => { auth: authKey } }, - alerts: push.alerts + data: { alerts: push.alerts } } const res = await apiInstance({ @@ -239,7 +238,6 @@ const TabMePush: React.FC = () => { setAccountStorage([ { key: 'push', value: { ...push, global: true, key: authKey } } ]) - if (Platform.OS === 'android') { setChannels(true) }