mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
fix(trace-viewer): when clicking on a step no snapshot was shown (#8038)
This commit is contained in:
parent
fcb8d5310a
commit
7ee92f3fc8
@ -37,7 +37,7 @@ export const SnapshotTab: React.FunctionComponent<{
|
||||
const snapshots = [actionSnapshot ? { ...actionSnapshot, title: 'action' } : undefined, snapshotMap.get('before'), snapshotMap.get('after')].filter(Boolean) as { title: string, snapshotName: string }[];
|
||||
|
||||
React.useEffect(() => {
|
||||
if (snapshotIndex >= snapshots.length)
|
||||
if (snapshots.length >= 1 && snapshotIndex >= snapshots.length)
|
||||
setSnapshotIndex(snapshots.length - 1);
|
||||
}, [snapshotIndex, snapshots]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user