Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351584
D4847.id15645.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
D4847.id15645.diff
View Options
diff --git a/web/settings/account-settings.react.js b/web/settings/account-settings.react.js
--- a/web/settings/account-settings.react.js
+++ b/web/settings/account-settings.react.js
@@ -2,9 +2,12 @@
import * as React from 'react';
-import { logOut } from 'lib/actions/user-actions';
+import { logOut, logOutActionTypes } from 'lib/actions/user-actions';
import { preRequestUserStateSelector } from 'lib/selectors/account-selectors';
-import { useServerCall } from 'lib/utils/action-utils';
+import {
+ useDispatchActionPromise,
+ useServerCall,
+} from 'lib/utils/action-utils';
import { useModalContext } from '../modals/modal-provider.react';
import { useSelector } from '../redux/redux-utils';
@@ -17,9 +20,15 @@
function AccountSettings(): React.Node {
const sendLogoutRequest = useServerCall(logOut);
const preRequestUserState = useSelector(preRequestUserStateSelector);
- const logOutUser = React.useCallback(() => {
- sendLogoutRequest(preRequestUserState);
- }, [sendLogoutRequest, preRequestUserState]);
+ const dispatchActionPromise = useDispatchActionPromise();
+ const logOutUser = React.useCallback(
+ () =>
+ dispatchActionPromise(
+ logOutActionTypes,
+ sendLogoutRequest(preRequestUserState),
+ ),
+ [dispatchActionPromise, preRequestUserState, sendLogoutRequest],
+ );
const { pushModal, popModal } = useModalContext();
const showPasswordChangeModal = React.useCallback(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 2:39 AM (21 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2572779
Default Alt Text
D4847.id15645.diff (1 KB)
Attached To
Mode
D4847: [web] Use dispatchActionPromise when logging out
Attached
Detach File
Event Timeline
Log In to Comment