Skip to content

Commit

Permalink
Reset instrumenter state on HMR
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Jun 20, 2022
1 parent e5c2bb6 commit 565304c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/instrumenter/src/instrumenter.ts
Expand Up @@ -133,6 +133,9 @@ export class Instrumenter {
this.channel.on(STORY_RENDER_PHASE_CHANGED, ({ storyId, newPhase }) => {
const { isDebugging } = this.getState(storyId);
this.setState(storyId, { renderPhase: newPhase });
if (newPhase === 'preparing' && isDebugging) {
resetState({ storyId });
}
if (newPhase === 'playing') {
resetState({ storyId, isDebugging });
}
Expand Down

0 comments on commit 565304c

Please sign in to comment.