From afd64202443803910563afcccea95a5caad2e741 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 21 May 2023 20:21:13 +0000 Subject: [PATCH] Refactor code :3 --- src/libpoketube/init/pages-video.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/libpoketube/init/pages-video.js b/src/libpoketube/init/pages-video.js index 0a3cb4c5..686c55f3 100644 --- a/src/libpoketube/init/pages-video.js +++ b/src/libpoketube/init/pages-video.js @@ -221,16 +221,9 @@ core.video(v).then((data) => { var uaos = req.useragent.os - var IsOldWindows; - - - if(uaos == "Windows 7" && req.useragent.browser == "Firefox" ) { - IsOldWindows = true - } else if(uaos == "Windows 8" && req.useragent.browser == "Firefox") { - IsOldWindows = true - } else { - IsOldWindows = false - } + const browser = req.useragent.browser; + const IsOldWindows = (uaos === "Windows 7" || uaos === "Windows 8") && browser === "Firefox"; + renderTemplate(res, req, "poketube.ejs", { color: data.color,