Skip to content

Commit

Permalink
Hide print button in RecoveryCodeNews on mobile, #4851
Browse files Browse the repository at this point in the history
fixes #4851
  • Loading branch information
nowhub authored and ganthern committed Dec 19, 2022
1 parent 555af97 commit b2df2b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/misc/news/items/RecoveryCodeNews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {UsageTestController} from "@tutao/tutanota-usagetests"
import {UserController} from "../../../api/main/UserController.js"
import {progressIcon} from "../../../gui/base/Icon.js"
import {UserManagementFacade} from "../../../api/worker/facades/UserManagementFacade.js"
import {isApp} from "../../../api/common/Env.js"

/** Actions that may be sent in stage 2 of the recoveryCodeDialog usage test. */
type RecoveryCodeNewsAction = "copy" | "print" | "select" | "dismiss" | "close"
Expand Down Expand Up @@ -141,6 +142,10 @@ export class RecoveryCodeNews implements NewsListItem {
}

private renderPrintButton(): Children {
if (isApp() || typeof window.print !== "function") {
return null
}

return m(Button, {
label: "print_action",
type: ButtonType.Secondary,
Expand Down

0 comments on commit b2df2b9

Please sign in to comment.