From 4d0025afc1a139c59ca2217071c548f1ab227cd2 Mon Sep 17 00:00:00 2001 From: Valtteri Karesto Date: Wed, 22 Jun 2022 14:42:39 +0300 Subject: [PATCH] Fix splitscreen error --- pages/test/[[...slug]].tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pages/test/[[...slug]].tsx b/pages/test/[[...slug]].tsx index b2bf913..f95c6eb 100644 --- a/pages/test/[[...slug]].tsx +++ b/pages/test/[[...slug]].tsx @@ -32,14 +32,20 @@ const Test = () => { if (!showComponent) { return null; } - const hasScripts = - snap.files.filter((f) => f.name.endsWith(".js")).length > 0; + const hasScripts = Boolean( + snap.files.filter((f) => f.name.toLowerCase()?.endsWith(".js")).length + ); + return ( { - {hasScripts && ( + {hasScripts ? ( { clearLog={() => (state.scriptLogs = [])} /> - )} + ) : null}