Skip to content

Commit

Permalink
[front] fix: in the comp. ui the glow effect is now triggered properly
Browse files Browse the repository at this point in the history
  • Loading branch information
GresilleSiffle committed Nov 14, 2024
1 parent 53a70e0 commit c86d16a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions frontend/src/features/comparisons/Comparison.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,22 @@ const Comparison = ({
searchParams.delete(LEGACY_PARAMS[vidKey]);
history.replace({ search: searchParams.toString() });
}

if (vidKey === 'vidA') {
setSelectorA(newValue);

if (newValue.uid !== selectorA.uid) {
setHasLoopedThroughCriteria?.(false);
}
} else if (vidKey === 'vidB') {
setSelectorB(newValue);
}

setHasLoopedThroughCriteria?.(false);
if (newValue.uid !== selectorB.uid) {
setHasLoopedThroughCriteria?.(false);
}
}
},
[history, setHasLoopedThroughCriteria]
[history, selectorA.uid, selectorB.uid, setHasLoopedThroughCriteria]
);

const onChangeA = useMemo(() => onChange('vidA'), [onChange]);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ code {

/* Custom animation to draw attention on buttons */
.glowing {
animation: glow 1.4s infinite alternate
animation: glow 1.4s infinite alternate;
}

@keyframes glow {
Expand Down

0 comments on commit c86d16a

Please sign in to comment.