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 authored and charlag committed Feb 3, 2022
1 parent e52bccb commit e3bf47d
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 {
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 e3bf47d

Please sign in to comment.