Skip to content

Commit 28d0289

Browse files
committed
Use try/finally syntax
1 parent ae5f888 commit 28d0289

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Diff for: ui/src/actions/login.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,14 @@ export function ssoLogIn() {
9999

100100
export function signOut() {
101101
return async (dispatch) => {
102+
dispatch(resetLoginInfo()); // disconnect sockets before actually logging out (cf. `App.jsx`)
102103
dispatch(applicationFetched(false));
103-
// We make sure that user data is reseted so that websockets
104-
// are keept dicconnected while logging out.
105-
dispatch(resetLoginInfo());
106-
await sendSignOut().finally(() =>
107-
dispatch(
108-
// Retreiving the user data from the backend
109-
getLoginInfo(),
110-
),
111-
);
104+
105+
try {
106+
await sendSignOut();
107+
} finally {
108+
dispatch(getLoginInfo());
109+
}
112110
};
113111
}
114112

0 commit comments

Comments
 (0)