From ee84f265b60be52d6daa0f9506e03ccd0790af95 Mon Sep 17 00:00:00 2001 From: paw Date: Fri, 16 Feb 2024 15:29:37 +0100 Subject: [PATCH] Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 --- src/settings/mailaddress/MailAddressTable.ts | 3 +-- src/settings/mailaddress/MailAddressTableModel.ts | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/settings/mailaddress/MailAddressTable.ts b/src/settings/mailaddress/MailAddressTable.ts index ebaf718bcd27..f79398db5bbd 100644 --- a/src/settings/mailaddress/MailAddressTable.ts +++ b/src/settings/mailaddress/MailAddressTable.ts @@ -17,7 +17,6 @@ import { AddressInfo, AddressStatus, MailAddressTableModel } from "./MailAddress import { showAddAliasDialog } from "./AddAliasDialog.js" import { locator } from "../../api/main/MainLocator.js" import { UpgradeRequiredError } from "../../api/main/UpgradeRequiredError.js" -import { PlanType } from "../../api/common/TutanotaConstants.js" assertMainOrNode() @@ -78,7 +77,7 @@ export class MailAddressTable implements Component { "{totalAmount}": model.aliasCount.totalAliases, }), ), - m(".small.mt-s", lang.get("mailAddressInfo_msg")), + model.hasUnlimitedCustomDomainAliases() ? m(".small.mt-s", lang.get("mailAddressInfo_msg")) : null, ] : null, ] diff --git a/src/settings/mailaddress/MailAddressTableModel.ts b/src/settings/mailaddress/MailAddressTableModel.ts index db1fc039d511..61b86928e44a 100644 --- a/src/settings/mailaddress/MailAddressTableModel.ts +++ b/src/settings/mailaddress/MailAddressTableModel.ts @@ -43,10 +43,12 @@ export interface MailAddressNameChanger { /** Model for showing the list of mail addresses and optionally adding more, enabling/disabling/setting names for them. */ export class MailAddressTableModel { private nameMappings: AddressToName | null = null + private onNewPaidPlan: boolean = false aliasCount: MailAddressAliasServiceReturn | null = null init: () => Promise = lazyMemoized(async () => { this.eventController.addEntityListener(this.entityEventsReceived) + this.onNewPaidPlan = await this.logins.getUserController().isNewPaidPlan() await this.loadNames() this.redraw() await this.loadAliasCount() @@ -72,6 +74,10 @@ export class MailAddressTableModel { return this.logins.getUserController().isGlobalAdmin() } + hasUnlimitedCustomDomainAliases(): boolean { + return this.onNewPaidPlan + } + addresses(): AddressInfo[] { const { nameMappings } = this if (nameMappings == null) {