From 53045be65cdd10a94385e4c0fd998231b9f3fc4e Mon Sep 17 00:00:00 2001 From: marcobaobao Date: Fri, 23 Jun 2023 11:46:44 +0200 Subject: [PATCH] code refactoring --- frontend/src/components/DownloadsCardView.tsx | 2 +- frontend/src/components/StackableResult.tsx | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/DownloadsCardView.tsx b/frontend/src/components/DownloadsCardView.tsx index 7e02d36..3e3bb8b 100644 --- a/frontend/src/components/DownloadsCardView.tsx +++ b/frontend/src/components/DownloadsCardView.tsx @@ -1,6 +1,5 @@ import { Grid } from "@mui/material" import { Fragment } from "react" - import type { RPCResult } from "../types" import { StackableResult } from "./StackableResult" @@ -17,6 +16,7 @@ export function DownloadsCardView({ downloads, abortFunction }: Props) { isCompleted ? 100 : Number(percentage.replace('%', '')) const guessResolution = (xByY: string): any => { - if (!xByY) return null; - if (xByY.includes('4320')) return (); - if (xByY.includes('2160')) return (); - if (xByY.includes('1080')) return (); - if (xByY.includes('720')) return (); - return null; + if (!xByY) return null + if (xByY.includes('4320')) return () + if (xByY.includes('2160')) return () + if (xByY.includes('1080')) return () + if (xByY.includes('720')) return () + return null } return ( - + navigator.clipboard.writeText(url)}> {thumbnail !== '' ?