Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent verify from invalidating stores #2564

Merged
merged 3 commits into from
Feb 28, 2024

Conversation

finnar-bin
Copy link
Contributor

@finnar-bin finnar-bin commented Feb 21, 2024

verify-fix.webm

@finnar-bin finnar-bin added the bug Something isn't working label Feb 21, 2024
@finnar-bin finnar-bin self-assigned this Feb 21, 2024
@@ -44,6 +45,12 @@ export const GlobalAccountMenu: FC<GlobalAccountMenuProps> = ({

const dispatch = useDispatch();

useEffect(() => {
if (!auth.valid) {
onClose();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why this is needed? Is this due to the logOut? Shouldnt we simply call onClose on the logOut handleClickAction?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agalin920 This makes sure that it only closes the global accounts menu once the user has been successfully logged out instead of it immediately closing and then there's a brief moment where nothing happens while waiting for the api call to resolve.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm not sure if having a brief moment where nothing happens while it is open is any better than closing it and having a brief delay. At least having it close makes it seem the action went off as opposed to clicking it multiple times thinking it didnt go through.

@shrunyan shrunyan merged commit 2fb3152 into master Feb 28, 2024
1 check passed
@shrunyan shrunyan deleted the fix/2559-verify-invalidating-stores branch February 28, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Perf: verify is invalidating multiple stores
3 participants