diff --git a/web/account/log-in-form.react.js b/web/account/log-in-form.react.js --- a/web/account/log-in-form.react.js +++ b/web/account/log-in-form.react.js @@ -113,12 +113,12 @@ [dispatchActionPromise, logInAction, loginExtraInfo, username], ); - let loginButtonContent; - if (inputDisabled) { - loginButtonContent = ; - } else { - loginButtonContent = 'Log in'; - } + const loginButtonContent = React.useMemo(() => { + if (inputDisabled) { + return ; + } + return 'Log in'; + }, [inputDisabled]); return (
diff --git a/web/modals/threads/settings/thread-settings-general-tab.react.js b/web/modals/threads/settings/thread-settings-general-tab.react.js --- a/web/modals/threads/settings/thread-settings-general-tab.react.js +++ b/web/modals/threads/settings/thread-settings-general-tab.react.js @@ -137,12 +137,12 @@ threadPermissions.EDIT_THREAD_NAME, ); - let loginButtonContent; - if (threadSettingsOperationInProgress) { - loginButtonContent = ; - } else { - loginButtonContent = 'Save'; - } + const saveButtonContent = React.useMemo(() => { + if (threadSettingsOperationInProgress) { + return ; + } + return 'Save'; + }, [threadSettingsOperationInProgress]); return (
@@ -188,7 +188,7 @@ disabled={threadSettingsOperationInProgress || !changeQueued} className={css.save_button} > - {loginButtonContent} + {saveButtonContent}
);