From bfdcfcec1aeb734d26f5396d22c89f764978186a Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 6 Mar 2024 18:13:39 -0600 Subject: [PATCH] resolve "can't add to fixed length list" exception --- .../involved/step_1a/complete_reshare_config_view.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/involved/step_1a/complete_reshare_config_view.dart b/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/involved/step_1a/complete_reshare_config_view.dart index 0e2e1e111..74cfaee17 100644 --- a/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/involved/step_1a/complete_reshare_config_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/involved/step_1a/complete_reshare_config_view.dart @@ -93,14 +93,14 @@ class _CompleteReshareConfigViewState ), ); } else { - final salts = frostInfo.knownSalts; - salts.add(salt); + final salts = frostInfo.knownSalts; // Fixed length list. + final newSalts = List.from(salts)..add(salt); final mainDB = ref.read(mainDBProvider); await mainDB.isar.writeTxn(() async { final info = frostInfo; await mainDB.isar.frostWalletInfo.delete(info.id); await mainDB.isar.frostWalletInfo.put( - info.copyWith(knownSalts: salts), + info.copyWith(knownSalts: newSalts), ); }); }