Skip to content

Commit f14c860

Browse files
authored
Merge pull request #881 from AppQuality/fix-set-current-time
FIX(ObservationTooltip.tsx): fix seekPlayer function call duplication
2 parents 1950bd6 + 1a81d08 commit f14c860

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/pages/Video/components/ObservationTooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ export const ObservationTooltip = ({
5959
size="large"
6060
color={color}
6161
onClick={() => {
62-
seekPlayer?.(start);
6362
setOpenAccordion({ id: observationId });
63+
seekPlayer?.(start);
6464
}}
6565
isSelecting={isSelecting}
6666
>

src/pages/Video/components/Player.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const CorePlayer = ({ video }: { video: GetVideosByVidApiResponse }) => {
5252
const [postVideoByVidObservations] = usePostVideosByVidObservationsMutation();
5353
const [patchObservation] = usePatchVideosByVidObservationsAndOidMutation();
5454
const [start, setStart] = useState<number | undefined>(undefined);
55-
const { context, setIsPlaying } = usePlayerContext();
55+
const { context } = usePlayerContext();
5656
const { currentTime } = context.player || { currentTime: 0 };
5757
const { addToast } = useToast();
5858

@@ -127,8 +127,6 @@ const CorePlayer = ({ video }: { video: GetVideosByVidApiResponse }) => {
127127
(time: number) => {
128128
if (videoRef && videoRef.current) {
129129
videoRef.current.currentTime = time;
130-
setIsPlaying(true);
131-
videoRef.current.play();
132130
}
133131
},
134132
[videoRef]
@@ -159,8 +157,8 @@ const CorePlayer = ({ video }: { video: GetVideosByVidApiResponse }) => {
159157
/>
160158
),
161159
onClick: () => {
162-
seekPlayer(obs.start);
163160
setOpenAccordion({ id: obs.id });
161+
seekPlayer(obs.start);
164162
},
165163
tags: obs.tags,
166164
})),

0 commit comments

Comments
 (0)