Page MenuHomePhabricator

D4930.diff
No OneTemporary

D4930.diff

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 = <LoadingIndicator status="loading" />;
- } else {
- loginButtonContent = 'Log in';
- }
+ const loginButtonContent = React.useMemo(() => {
+ if (inputDisabled) {
+ return <LoadingIndicator status="loading" />;
+ }
+ return 'Log in';
+ }, [inputDisabled]);
return (
<div className={css['modal-body']}>
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 = <LoadingIndicator status="loading" />;
- } else {
- loginButtonContent = 'Save';
- }
+ const saveButtonContent = React.useMemo(() => {
+ if (threadSettingsOperationInProgress) {
+ return <LoadingIndicator status="loading" />;
+ }
+ return 'Save';
+ }, [threadSettingsOperationInProgress]);
return (
<form method="POST">
@@ -188,7 +188,7 @@
disabled={threadSettingsOperationInProgress || !changeQueued}
className={css.save_button}
>
- {loginButtonContent}
+ {saveButtonContent}
</Button>
</form>
);

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 8:14 PM (18 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2696211
Default Alt Text
D4930.diff (1 KB)

Event Timeline