Skip to content

Commit

Permalink
refactor: rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
WofWca committed Jul 17, 2024
1 parent bb46633 commit 912c742
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/renderer/components/dialogs/EditAccountAndPasswordDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ function EditAccountInner(onClose: DialogProps['onClose']) {
const [accountSettings, _setAccountSettings] =
useState<Credentials>(defaultCredentials())

const [disableUpdate, setDisableUpdate] = useState(true)
const [userNeverChangedAccountSettings, setUserNeverChangedAccountSettings] =
useState(true)

const { openDialog } = useDialog()
const openConfirmationDialog = useConfirmationDialog()
const tx = useTranslationFunction()

const setAccountSettings = (value: Credentials) => {
disableUpdate === true && setDisableUpdate(false)
userNeverChangedAccountSettings === true &&
setUserNeverChangedAccountSettings(false)
_setAccountSettings(value)
}

Expand Down Expand Up @@ -86,7 +88,7 @@ function EditAccountInner(onClose: DialogProps['onClose']) {
}, [])

const onUpdate = useCallback(async () => {
if (disableUpdate) return true
if (userNeverChangedAccountSettings) return true
const onSuccess = () => onClose()

const update = () => {
Expand Down Expand Up @@ -117,7 +119,7 @@ function EditAccountInner(onClose: DialogProps['onClose']) {
}
}, [
accountSettings,
disableUpdate,
userNeverChangedAccountSettings,
initial_settings.addr,
onClose,
openConfirmationDialog,
Expand Down

0 comments on commit 912c742

Please sign in to comment.