Skip to content

Commit

Permalink
Don't show incorrect mail address info on legacy plans
Browse files Browse the repository at this point in the history
It is not true that legacy plans can have unlimited custom domains. Make
it not display anything here to prevent confusion.

Fixes #6540
  • Loading branch information
paw-hub committed Feb 16, 2024
1 parent 005a580 commit ee84f26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/settings/mailaddress/MailAddressTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -78,7 +77,7 @@ export class MailAddressTable implements Component<MailAddressTableAttrs> {
"{totalAmount}": model.aliasCount.totalAliases,
}),
),
m(".small.mt-s", lang.get("mailAddressInfo_msg")),
model.hasUnlimitedCustomDomainAliases() ? m(".small.mt-s", lang.get("mailAddressInfo_msg")) : null,
]
: null,
]
Expand Down
6 changes: 6 additions & 0 deletions src/settings/mailaddress/MailAddressTableModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> = lazyMemoized(async () => {
this.eventController.addEntityListener(this.entityEventsReceived)
this.onNewPaidPlan = await this.logins.getUserController().isNewPaidPlan()
await this.loadNames()
this.redraw()
await this.loadAliasCount()
Expand All @@ -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) {
Expand Down

0 comments on commit ee84f26

Please sign in to comment.