// @flow import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; import { SETTINGS_GRP } from 'constants/settings'; import React from 'react'; import Button from 'component/button'; import Card from 'component/common/card'; import SettingsRow from 'component/settingsRow'; import SyncToggle from 'component/syncToggle'; import { getPasswordFromCookie } from 'util/saved-passwords'; type Props = { isAuthenticated: boolean, walletEncrypted: boolean, user: User, hasChannels: boolean, doWalletStatus: () => void, }; export default function SettingAccount(props: Props) { const { isAuthenticated, walletEncrypted, hasChannels, doWalletStatus } = props; const [storedPassword, setStoredPassword] = React.useState(false); // Determine if password is stored. React.useEffect(() => { doWalletStatus(); getPasswordFromCookie().then((p) => { if (typeof p === 'string') { setStoredPassword(true); } }); }, []); // eslint-disable-line react-hooks/exhaustive-deps return ( <>