Skip to content

Commit

Permalink
feat(dcellar-web-ui): fix off chain data removed
Browse files Browse the repository at this point in the history
  • Loading branch information
aiden-cao committed Aug 11, 2023
1 parent d60d5f9 commit cd94187
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions apps/dcellar-web-ui/src/context/LoginContext/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ export function LoginContextProvider(props: PropsWithChildren<LoginContextProvid
const dispatch = useAppDispatch();
const { children, inline = false } = props;
const { loginAccount } = useAppSelector((root) => root.persist);


const { disconnect } = useDisconnect();

const logout = useCallback(
(removeSpAuth = true) => {
dispatch(resetUploadQueue({loginAccount}))
(removeSpAuth = false) => {
dispatch(resetUploadQueue({ loginAccount }));
dispatch(setLogout(removeSpAuth));
disconnect();
},
Expand Down Expand Up @@ -57,14 +56,14 @@ export function LoginContextProvider(props: PropsWithChildren<LoginContextProvid
// to avoid errors when using the connector, we treat this situation as logout.
const timer = setTimeout(() => {
if (!connector) {
logout()
logout();
}
}, 1000)
}, 1000);

return () => {
clearTimeout(timer)
}
}, [connector, inline, loginAccount, logout, pathname, walletAddress])
clearTimeout(timer);
};
}, [connector, inline, loginAccount, logout, pathname, walletAddress]);

useAsyncEffect(async () => {
if (loginAccount === walletAddress) {
Expand Down

0 comments on commit cd94187

Please sign in to comment.