File tree Expand file tree Collapse file tree
lib/ui/home/cards/accounts/detail/coins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,6 +263,7 @@ class _CreateCoinTagState extends ConsumerState<CreateCoinTag> {
263263 if (! context.mounted) return ;
264264
265265 bool isUntagged = false ;
266+ bool isLastUntaggedCoins = false ;
266267 try {
267268 final selectedAccount = ref.read (selectedAccountProvider);
268269 if (selectedAccount == null ) {
@@ -278,6 +279,19 @@ class _CreateCoinTagState extends ConsumerState<CreateCoinTag> {
278279 tag = "" ;
279280 isUntagged = true ;
280281 }
282+
283+ // Check if these coins are the last untagged coins before tagging them
284+ if (! isUntagged) {
285+ final allTags = ref.read (tagsProvider (widget.accountId));
286+ final untaggedList = allTags.where ((t) => t.untagged).toList ();
287+ if (untaggedList.isNotEmpty) {
288+ final untaggedIds =
289+ untaggedList.first.utxo.map ((u) => u.getId ()).toSet ();
290+ final coinIds = widget.coins.map ((c) => c.getId ()).toSet ();
291+ isLastUntaggedCoins = untaggedIds.every ((id) => coinIds.contains (id));
292+ }
293+ }
294+
281295 setState (() {
282296 _isLoading = true ;
283297 });
@@ -290,7 +304,7 @@ class _CreateCoinTagState extends ConsumerState<CreateCoinTag> {
290304 });
291305 if (context.mounted) {
292306 Navigator .of (context).pop ();
293- if (isUntagged) {
307+ if (isUntagged || isLastUntaggedCoins ) {
294308 Navigator .of (context).pop ();
295309 }
296310 }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
1919# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
2020# Read more about iOS versioning at
2121# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
22- version : 2.2.14+11
22+ version : 2.2.14+12
2323
2424environment :
2525 sdk : " >=3.5.0 <4.0.0"
You can’t perform that action at this time.
0 commit comments