Skip to content

Commit

Permalink
Only show Mail Export Settings UI on desktop
Browse files Browse the repository at this point in the history
Close #8116
  • Loading branch information
hrb-hub committed Dec 19, 2024
1 parent e12dcc5 commit 4ccec4b
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/mail-app/settings/MailSettingsViewer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import m, { Children } from "mithril"
import { assertMainOrNode, isApp } from "../../common/api/common/Env"
import { assertMainOrNode, isApp, isDesktop } from "../../common/api/common/Env"
import { lang } from "../../common/misc/LanguageViewModel"
import type { MailboxGroupRoot, MailboxProperties, OutOfOfficeNotification, TutanotaProperties } from "../../common/api/entities/tutanota/TypeRefs.js"
import {
Expand Down Expand Up @@ -90,10 +90,13 @@ export class MailSettingsViewer implements UpdatableSettingsViewer {
this._inboxRulesTableLines = stream<Array<TableLineAttrs>>([])
this._outOfOfficeStatus = stream(lang.get("deactivated_label"))
this._indexStateWatch = null
mailLocator.mailExportController().then((controller) => {
this.mailExportController = controller
m.redraw()
})
if (isDesktop()) {
// export is only available on desktop
mailLocator.mailExportController().then((controller) => {
this.mailExportController = controller
m.redraw()
})
}
// normally we would maybe like to get it as an argument but these viewers are created in an odd way
mailLocator.mailAddressTableModelForOwnMailbox().then((model) => {
this.mailAddressTableModel = model
Expand Down Expand Up @@ -389,14 +392,14 @@ export class MailSettingsViewer implements UpdatableSettingsViewer {
}),
),
],
m(".h4.mt-l", lang.get("exportMailbox_label")),
this.mailExportController
? m(MailExportSettings, {
mailboxDetails: mailLocator.mailboxModel.mailboxDetails(),
logins: mailLocator.logins,
mailExportController: this.mailExportController,
})
: null,
this.mailExportController && [
m(".h4.mt-l", lang.get("exportMailbox_label")),
m(MailExportSettings, {
mailboxDetails: mailLocator.mailboxModel.mailboxDetails(),
logins: mailLocator.logins,
mailExportController: this.mailExportController,
}),
],
],
),
]
Expand Down

0 comments on commit 4ccec4b

Please sign in to comment.