Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion code/core/src/component-testing/components/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,18 @@ export const Panel = memo<{ refId?: string; storyId: string; storyUrl: string }>
);
},
[STORY_RENDER_PHASE_CHANGED]: (event) => {
if (event.newPhase === 'preparing' || event.newPhase === 'loading') {
// A render cycle may not actually make it to the rendering phase.
// We don't want to update any state until it does.
return;
}

lastRenderId.current = Math.max(lastRenderId.current, event.renderId || 0);
if (lastRenderId.current !== event.renderId) {
return;
}

if (event.newPhase === 'preparing') {
if (event.newPhase === 'rendering') {
log.current = [getInternalRenderLogItem(CallStates.ACTIVE)];
calls.current.set(INTERNAL_RENDER_CALL_ID, getInternalRenderCall(storyId));
set({
Expand Down
Loading