Skip to content

Commit

Permalink
refactor(neon): Remove unnecessary options resets for invalid values
Browse files Browse the repository at this point in the history
Signed-off-by: jld3103 <jld3103yt@gmail.com>
  • Loading branch information
provokateurin committed Nov 2, 2023
1 parent ec941c1 commit 6c80d47
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions packages/neon/neon/lib/src/utils/global_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand All @@ -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.
Expand Down

0 comments on commit 6c80d47

Please sign in to comment.