Skip to content

Commit

Permalink
Merge pull request #18516 from storybookjs/ghengeveld/sb-167-sb17570-…
Browse files Browse the repository at this point in the history
…addon-interactions-panel-does

Interactions: Reset instrumenter state on HMR
  • Loading branch information
shilman committed Jun 21, 2022
2 parents 0a38662 + 565304c commit a3348bf
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 a3348bf

Please sign in to comment.