diff --git a/BTCPayServer/Components/StoreSelector/StoreSelector.cs b/BTCPayServer/Components/StoreSelector/StoreSelector.cs index c99f4b4ee..744a2d95d 100644 --- a/BTCPayServer/Components/StoreSelector/StoreSelector.cs +++ b/BTCPayServer/Components/StoreSelector/StoreSelector.cs @@ -41,14 +41,13 @@ namespace BTCPayServer.Components.StoreSelector .FirstOrDefault()? .Network.CryptoCode; var walletId = cryptoCode != null ? new WalletId(store.Id, cryptoCode) : null; - var role = store.GetStoreRoleOfUser(userId); return new StoreSelectorOption { Text = store.StoreName, Value = store.Id, Selected = store.Id == currentStore?.Id, WalletId = walletId, - Store = store, + Store = store }; }) .OrderBy(s => s.Text) diff --git a/BTCPayServer/Controllers/UIHomeController.cs b/BTCPayServer/Controllers/UIHomeController.cs index 2730576a3..8b1ab5ee8 100644 --- a/BTCPayServer/Controllers/UIHomeController.cs +++ b/BTCPayServer/Controllers/UIHomeController.cs @@ -84,8 +84,9 @@ namespace BTCPayServer.Controllers } var stores = await _storeRepository.GetStoresByUserId(userId); - return stores.Any() - ? RedirectToStore(userId, stores.First()) + var activeStore = stores.FirstOrDefault(s => !s.Archived); + return activeStore != null + ? RedirectToStore(userId, activeStore) : RedirectToAction(nameof(UIUserStoresController.CreateStore), "UIUserStores"); }