From 912c742621d906d8e8be82e2344da3ab79ea1555 Mon Sep 17 00:00:00 2001 From: WofWca Date: Wed, 17 Jul 2024 17:10:16 +0400 Subject: [PATCH] refactor: rename variable --- .../dialogs/EditAccountAndPasswordDialog.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/dialogs/EditAccountAndPasswordDialog.tsx b/src/renderer/components/dialogs/EditAccountAndPasswordDialog.tsx index ef9f23d13f..cc52c221a6 100644 --- a/src/renderer/components/dialogs/EditAccountAndPasswordDialog.tsx +++ b/src/renderer/components/dialogs/EditAccountAndPasswordDialog.tsx @@ -37,14 +37,16 @@ function EditAccountInner(onClose: DialogProps['onClose']) { const [accountSettings, _setAccountSettings] = useState(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) } @@ -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 = () => { @@ -117,7 +119,7 @@ function EditAccountInner(onClose: DialogProps['onClose']) { } }, [ accountSettings, - disableUpdate, + userNeverChangedAccountSettings, initial_settings.addr, onClose, openConfirmationDialog,