Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(ui): disable app password on windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
korhaliv committed Oct 24, 2019
1 parent b185fc5 commit 31d1695
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ module.exports = {

secureStorage: {
namespace: IS_STABLE_VERSION ? 'ln-zap' : 'ln-zap-next',
isWinPlatformSupported: false,
},

// feature flags to enable/disable experimental functionality
Expand Down
17 changes: 11 additions & 6 deletions renderer/components/Settings/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useFormState, useFormApi } from 'informed'
import styled from 'styled-components'
import { Box, Flex } from 'rebass/styled-components'
import merge from 'lodash/merge'
import config from 'config'
import difference from '@zap/utils/difference'
import { ActionBar, Button, Heading, MainContent, Menu, Panel, Sidebar } from 'components/UI'
import ZapLogo from 'components/Icon/ZapLogo'
Expand All @@ -17,6 +18,8 @@ import PasswordPromptDialog from 'containers/Settings/PasswordPromptDialog'
import PasswordSetDialog from 'containers/Settings/PasswordSetDialog'
import messages from './messages'

const isSecurityPaneEnabled = window.Zap.getPlatform() !== 'win32' || config.isWinPlatformSupported

const SettingsMenu = ({ group, setGroup, isLoggedIn, ...rest }) => {
// Items accessible to unauthenticated users.
const anonItems = [
Expand All @@ -34,15 +37,17 @@ const SettingsMenu = ({ group, setGroup, isLoggedIn, ...rest }) => {
title: <FormattedMessage {...messages.fieldgroup_wallet} />,
onClick: () => setGroup('wallet'),
},
{
id: 'security',
title: <FormattedMessage {...messages.fieldgroup_security} />,
onClick: () => setGroup('security'),
},
]

let items = [...anonItems]
if (isLoggedIn) {
if (isSecurityPaneEnabled) {
authItems.push({
id: 'security',
title: <FormattedMessage {...messages.fieldgroup_security} />,
onClick: () => setGroup('security'),
})
}
items = items.concat(authItems)
}

Expand Down Expand Up @@ -118,7 +123,7 @@ const SettingsPage = ({
const fieldgroups = {
general: SettingsFieldsGeneral,
wallet: SettingsFieldsWallet,
security: SettingsFieldsSecurity,
security: isSecurityPaneEnabled && SettingsFieldsSecurity,
}

const FieldGroup = fieldgroups[group]
Expand Down

0 comments on commit 31d1695

Please # to comment.