Skip to content

Commit

Permalink
revert back the logic check
Browse files Browse the repository at this point in the history
  • Loading branch information
thafryer committed Feb 23, 2024
1 parent ef8d100 commit 6a53faf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/screens/VisualTests/SnapshotComparison.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,16 @@ export const SnapshotComparison = ({
selectedTest.result !== TestResult.Added &&
selectedTest.status !== TestStatus.Accepted;

const isNewBaseline =
selectedComparison.result === ComparisonResult.Added || selectedTest.result === TestResult.Added

useEffect(() => {
// It's possible this component doesn't unmount when the selected build, comparison, or story changes, so we need to reset state values.
// This is most important for the baseline image toggle because baseline can not exist for a different story.
if (
prevStoryIdRef.current !== storyId ||
prevSelectedComparisonIdRef.current !== selectedStory.selectedComparison?.id ||
prevSelectedBuildIdRef.current !== selectedBuild.id ||
isNewBaseline
isNewStory ||
isNewMode ||
isNewBrowser
) {
toggleBaselineImage(false);
toggleSettings(false);
Expand All @@ -196,7 +195,6 @@ export const SnapshotComparison = ({
toggleBaselineImage,
toggleSettings,
toggleWarnings,
isNewBaseline
]);

const storyInfo = (
Expand Down

0 comments on commit 6a53faf

Please sign in to comment.