Skip to content

Commit

Permalink
useBlockSync: change subscribed.current on unsubscribe (#47752)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr authored Feb 6, 2023
1 parent 58ba1a8 commit fdc4aa7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ export default function useBlockSync( {
previousAreBlocksDifferent = areBlocksDifferent;
} );

return () => unsubscribe();
return () => {
subscribed.current = false;
unsubscribe();
};
}, [ registry, clientId ] );
}

1 comment on commit fdc4aa7

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in fdc4aa7.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4102541927
📝 Reported issues:

Please sign in to comment.