From 52f33d79e0b58ee16cbe52919facd99760859d47 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 27 Aug 2024 17:38:14 -0400 Subject: [PATCH] Correctly registering the distributor at startup --- .../amethyst/service/notifications/PushNotificationUtils.kt | 3 +++ .../amethyst/ui/components/SelectNotificationProvider.kt | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt b/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt index d0188aa9f..21ca41b1f 100644 --- a/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt +++ b/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt @@ -34,6 +34,9 @@ object PushNotificationUtils { } try { if (pushHandler.savedDistributorExists()) { + val currentDistributor = PushDistributorHandler.getSavedDistributor() + PushDistributorHandler.saveDistributor(currentDistributor) + RegisterAccounts(accounts).go(pushHandler.getSavedEndpoint()) } } catch (e: Exception) { diff --git a/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt b/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt index ccedd30c5..fa593526b 100644 --- a/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt +++ b/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt @@ -150,9 +150,6 @@ fun SelectNotificationProvider(sharedPreferencesViewModel: SharedPreferencesView ) } } - } else { - val currentDistributor = PushDistributorHandler.getSavedDistributor() - PushDistributorHandler.saveDistributor(currentDistributor) } } }