From 6c80d47cb1b4fc2866d4e0ba348c8065ca1a39b6 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Thu, 2 Nov 2023 17:45:37 +0100 Subject: [PATCH] refactor(neon): Remove unnecessary options resets for invalid values Signed-off-by: jld3103 --- packages/neon/neon/lib/src/utils/global_options.dart | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/neon/neon/lib/src/utils/global_options.dart b/packages/neon/neon/lib/src/utils/global_options.dart index e5d57616d35..916020a02e2 100644 --- a/packages/neon/neon/lib/src/utils/global_options.dart +++ b/packages/neon/neon/lib/src/utils/global_options.dart @@ -101,10 +101,6 @@ class GlobalOptions extends OptionsCollection { (final account) => MapEntry(account.id, (final context) => account.humanReadableID), ), ); - - if (!initialAccount.values.containsKey(initialAccount.value)) { - initialAccount.reset(); - } } /// Updates the values of [pushNotificationsDistributor]. @@ -118,12 +114,7 @@ class GlobalOptions extends OptionsCollection { ), ); - final allowed = pushNotificationsDistributor.values.containsKey(pushNotificationsDistributor.value); - pushNotificationsEnabled.enabled = allowed; - if (!allowed) { - pushNotificationsDistributor.reset(); - pushNotificationsEnabled.reset(); - } + pushNotificationsEnabled.enabled = pushNotificationsDistributor.value != null; } /// The theme mode of the app implementing the Neon framework.