Skip to content

Commit

Permalink
fix(ui): fix out of range warning (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarthificial committed Feb 7, 2024
1 parent 7dafea0 commit c9f466f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/components/timeline/RangeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export function RangeSelector({rangeRef}: RangeSelectorProps) {

return (
<div
ref={rangeRef}
className={clsx(
styles.rangeTrack,
shiftHeld && controlHeld && styles.active,
Expand Down Expand Up @@ -79,6 +78,7 @@ export function RangeSelector({rangeRef}: RangeSelectorProps) {
}}
>
<div
ref={rangeRef}
style={{
flexDirection: start > end ? 'row-reverse' : 'row',
left: `${framesToPercents(Math.ceil(Math.max(0, normalizedStart)))}%`,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/timeline/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function Timeline() {

const isInUserRange = player.isInUserRange(frame);
const isOutOfRange = player.isInRange(frame) && !isInUserRange;
if (!warnedAboutRange && !reduceMotion && isOutOfRange) {
if (!warnedAboutRange.current && !reduceMotion && isOutOfRange) {
warnedAboutRange.current = true;
rangeRef.current?.animate(borderHighlight(), {
duration: 200,
Expand Down

0 comments on commit c9f466f

Please sign in to comment.