mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 05:39:57 -05:00
Only scrolling to top when changing videos. Clearing old video when changing videos.
This commit is contained in:
parent
6854fa3692
commit
b163b60837
2 changed files with 10 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import React, {useState} from 'react';
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {Link, Route, Routes, useParams} from "react-router-dom";
|
||||
import {
|
||||
defaultSearchOrder,
|
||||
|
|
@ -22,7 +22,9 @@ import {deleteVideos} from "../api";
|
|||
export function VideoWrapper() {
|
||||
const {videoId} = useParams();
|
||||
const {videoFile, prevFile, nextFile, setFavorite} = useVideo(videoId);
|
||||
scrollToTop();
|
||||
|
||||
// Scroll to the top when videoId changes.
|
||||
useEffect(scrollToTop, [videoId]);
|
||||
|
||||
return <VideoPage videoFile={videoFile} prevFile={prevFile} nextFile={nextFile}
|
||||
setFavorite={setFavorite} autoplay={true}/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue