Fixed an issue where merged accounts are counting as 1 account for premium limit.

This commit is contained in:
Burak Kaan Köse
2024-06-13 22:51:29 +02:00
parent 545880dcce
commit 690e04c377
4 changed files with 10 additions and 1 deletions

View File

@@ -29,5 +29,10 @@ namespace Wino.Core.Domain.Interfaces
/// Provider details of the account.
/// </summary>
IProviderDetail ProviderDetail { get; set; }
/// <summary>
/// How many accounts this provider has.
/// </summary>
int HoldingAccountCount { get; }
}
}

View File

@@ -42,7 +42,7 @@ namespace Wino.Mail.ViewModels
public bool IsPurchasePanelVisible => !HasUnlimitedAccountProduct;
public bool IsAccountCreationAlmostOnLimit => Accounts != null && Accounts.Count == FREE_ACCOUNT_COUNT - 1;
public bool HasAccountsDefined => Accounts != null && Accounts.Any();
public bool CanReorderAccounts => Accounts?.Count > 1;
public bool CanReorderAccounts => Accounts?.Sum(a => a.HoldingAccountCount) > 1;
public string UsedAccountsString => string.Format(Translator.WinoUpgradeRemainingAccountsMessage, Accounts.Count, FREE_ACCOUNT_COUNT);

View File

@@ -21,6 +21,8 @@ namespace Wino.Mail.ViewModels.Data
public string StartupEntityAddresses => Account.Address;
public int HoldingAccountCount => 1;
public AccountProviderDetailViewModel(IProviderDetail providerDetail, MailAccount account)
{
ProviderDetail = providerDetail;

View File

@@ -24,6 +24,8 @@ namespace Wino.Mail.ViewModels.Data
public string StartupEntityAddresses => AccountAddresses;
public int HoldingAccountCount => HoldingAccounts.Count;
public MergedAccountProviderDetailViewModel(MergedInbox mergedInbox, List<AccountProviderDetailViewModel> holdingAccounts)
{
MergedInbox = mergedInbox;