From 4f0b04da670fabca19b5c21eae54b3d34c296f8b Mon Sep 17 00:00:00 2001 From: Carl <52598902+1109471432@users.noreply.github.com> Date: Wed, 2 Nov 2022 19:53:00 +0800 Subject: [PATCH] =?UTF-8?q?Change=20the=20order=20of=20the=20videos=20to?= =?UTF-8?q?=20reverse=20order(I=20think=20people=20want=20t=E2=80=A6=20(#5?= =?UTF-8?q?02)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Change the order of the videos to reverse order(I think people want to see the newest video more) * fix 503 (When a video file missing a comma other videos can not display) --- ui/src/components/Videos/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/components/Videos/index.js b/ui/src/components/Videos/index.js index 64298aae..746a559b 100644 --- a/ui/src/components/Videos/index.js +++ b/ui/src/components/Videos/index.js @@ -7,13 +7,13 @@ import BeatLoader from "react-spinners/BeatLoader"; const Videos = ({ videos = [], query = "" }) => { const preloadVal = videos.length > 100 ? "none" : "auto"; - const filtered = videos.filter(fname => fname.includes(query)); + const filtered = videos.filter((fname) => fname.includes(query) && fname.includes(".")).reverse(); return ( {filtered.length && - filtered.map(fname => { + filtered.map((fname) => { const src = `/video/${fname}`; const session = fname.match(/.*(?=\.)/)[0];