From 29f6330f1150ef3f92a6738bf26d8bcc3a195ce7 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Tue, 29 Aug 2023 17:13:35 +0200 Subject: [PATCH] fix(neon): import of removed initialAccount Signed-off-by: Nikolas Rimikis --- packages/neon/neon/lib/src/utils/global_options.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/neon/neon/lib/src/utils/global_options.dart b/packages/neon/neon/lib/src/utils/global_options.dart index dfaf4a5c..f4821c06 100644 --- a/packages/neon/neon/lib/src/utils/global_options.dart +++ b/packages/neon/neon/lib/src/utils/global_options.dart @@ -92,14 +92,13 @@ class GlobalOptions extends OptionsCollection { } void updateAccounts(final List accounts) { - if (accounts.isEmpty) { - return; - } initialAccount.values = { - for (final account in accounts) ...{ - account.id: (final context) => account.humanReadableID, - }, + for (final account in accounts) account.id: (final context) => account.humanReadableID, }; + + if (accounts.tryFind(initialAccount.value) == null) { + initialAccount.reset(); + } } Future updateDistributors(final List distributors) async {