Skip to content

Commit

Permalink
[desktop] changes after review by ivk
Browse files Browse the repository at this point in the history
don't show credential encryption options if there are
no options

#3733
  • Loading branch information
ganthern committed Jan 27, 2022
1 parent f1cda03 commit 86e3970
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/misc/credentials/CredentialsProviderFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export function usingKeychainAuthentication(): boolean {
return isApp() || isDesktop()
}

export function hasKeychainAuthenticationOptions(): boolean {

This comment has been minimized.

Copy link
@charlag

charlag Feb 1, 2022

Contributor

I was confused at first why we don't just check for available methods but I realized it's async and we probably still want to show it on mobile at all times so I guess it's fine

return isApp()
}

/**
* Factory method for credentials provider that will return an instance injected with the implementations appropriate for the platform.
* @param deviceEncryptionFacade
Expand Down
4 changes: 2 additions & 2 deletions src/settings/LoginSettingsViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {ifAllowedTutanotaLinks} from "../gui/base/GuiUtils"
import type {UpdatableSettingsViewer} from "./SettingsView"
import {CredentialEncryptionMode} from "../misc/credentials/CredentialEncryptionMode"
import type {ICredentialsProvider} from "../misc/credentials/CredentialsProvider"
import {usingKeychainAuthentication} from "../misc/credentials/CredentialsProviderFactory"
import {hasKeychainAuthenticationOptions} from "../misc/credentials/CredentialsProviderFactory"
import {showCredentialsEncryptionModeDialog} from "../gui/dialogs/SelectCredentialsEncryptionModeDialog"
import {assertMainOrNode} from "../api/common/Env"
import {locator} from "../api/main/MainLocator"
Expand Down Expand Up @@ -140,7 +140,7 @@ export class LoginSettingsViewer implements UpdatableSettingsViewer {
}

private _renderEncryptionModeField(): Children {
if (!usingKeychainAuthentication()) {
if (!hasKeychainAuthenticationOptions()) {
return null
}

Expand Down

0 comments on commit 86e3970

Please sign in to comment.