Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3520950
D4930.id15890.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4930.id15890.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D4930: [web] Memoize `loginButtonContent` and `saveButtonContent`
Attached
Detach File
Event Timeline
Log In to Comment