Skip to content

Commit c16ff0e

Browse files
authored
Fixed an issue where the add item button was disabled in empty bundles (#7569)
1 parent 4f13afe commit c16ff0e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Files/ViewModels/Widgets/Bundles/BundleContainerViewModel.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public bool NoBundleContentsTextLoad
7878
set => SetProperty(ref noBundleContentsTextLoad, value);
7979
}
8080

81-
private bool isAddItemOptionEnabled;
81+
private bool isAddItemOptionEnabled = true;
8282

8383
public bool IsAddItemOptionEnabled
8484
{
@@ -493,6 +493,7 @@ public async Task<bool> AddBundleItem(BundleItemViewModel bundleItem)
493493
Contents.Add(bundleItem);
494494
itemAddedInternally = false;
495495
NoBundleContentsTextLoad = false;
496+
IsAddItemOptionEnabled = Contents.Count < Constants.Widgets.Bundles.MaxAmountOfItemsPerBundle;
496497
await bundleItem.UpdateIcon();
497498
return true;
498499
}
@@ -520,11 +521,6 @@ public async Task<BundleContainerViewModel> SetBundleItems(IEnumerable<BundleIte
520521

521522
await AddBundleItems(items);
522523

523-
if (Contents.Count > 0)
524-
{
525-
NoBundleContentsTextLoad = false;
526-
}
527-
528524
return this;
529525
}
530526

0 commit comments

Comments
 (0)