Page MenuHomePhabricator

D4930.id15890.diff
No OneTemporary

D4930.id15890.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
Tue, Dec 24, 1:48 AM (15 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2696211
Default Alt Text
D4930.id15890.diff (1 KB)

Event Timeline