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

fix: guard restore action with isTimeTravelling atom #174

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

arjunvegda
Copy link
Member

Copy link

codesandbox-ci bot commented Feb 1, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@@ -40,7 +41,11 @@ export const SnapshotActions = (props: SnapshotActionsProps) => {
const handleOnRestoreClick = () => {
setJustRestored(true);
start();
gotoSnapshot(props.snapshotToGoTo);
flushSync(() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Not super happy about using flushSync, maybe I should use store.set directly here 🤔

@arjunvegda arjunvegda merged commit 8a2d303 into main Feb 2, 2025
3 checks passed
@arjunvegda arjunvegda deleted the fix/restore-guard-on-snapshot-actions branch February 2, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant