From ca9720e12b4ac21bb785ec34d82d682560c0ccb9 Mon Sep 17 00:00:00 2001 From: Sharun Date: Wed, 8 Nov 2023 10:12:09 -0500 Subject: [PATCH] updated to use --- src/features/gallery/GalleryImg.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/features/gallery/GalleryImg.tsx b/src/features/gallery/GalleryImg.tsx index cb2450a2b7..c07ef4c27e 100644 --- a/src/features/gallery/GalleryImg.tsx +++ b/src/features/gallery/GalleryImg.tsx @@ -3,8 +3,8 @@ import "photoswipe/dist/photoswipe.css"; import { PostView } from "lemmy-js-client"; import { GalleryContext } from "./GalleryProvider"; import { PreparedPhotoSwipeOptions } from "photoswipe"; -import mime from "mime"; import Video from "../shared/Video"; +import { isUrlVideo } from "../../helpers/lemmy"; export interface GalleryImgProps { src?: string; @@ -35,11 +35,7 @@ export function GalleryImg({ const imgRef = useRef(null); const { open } = useContext(GalleryContext); - const mt = mime.getType(`${src}`); - - const isVideo = mt?.startsWith("video/"); - - const InnerComponent = !isVideo ? ( + return !isUrlVideo(`${src}`) ? ( ); - - return InnerComponent; }