Browse Source

refactor(neon): Remove unnecessary options resets for invalid values

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/1079/head
jld3103 1 year ago
parent
commit
4f94102352
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 11
      packages/neon/neon/lib/src/utils/global_options.dart

11
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), (final account) => MapEntry(account.id, (final context) => account.humanReadableID),
), ),
); );
if (!initialAccount.values.containsKey(initialAccount.value)) {
initialAccount.reset();
}
} }
/// Updates the values of [pushNotificationsDistributor]. /// Updates the values of [pushNotificationsDistributor].
@ -118,12 +114,7 @@ class GlobalOptions extends OptionsCollection {
), ),
); );
final enabled = pushNotificationsDistributor.values.isNotEmpty; pushNotificationsEnabled.enabled = pushNotificationsDistributor.values.isNotEmpty;
pushNotificationsEnabled.enabled = enabled;
if (!enabled) {
pushNotificationsDistributor.reset();
pushNotificationsEnabled.reset();
}
} }
/// The theme mode of the app implementing the Neon framework. /// The theme mode of the app implementing the Neon framework.

Loading…
Cancel
Save