From 6d73e50aa49f96724dc0a4daa75831a9a5b38bec Mon Sep 17 00:00:00 2001 From: ashley Date: Wed, 17 Sep 2025 17:29:16 +0200 Subject: [PATCH] refactor code --- html/channel.ejs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/html/channel.ejs b/html/channel.ejs index ac23c5f3..19b59f52 100644 --- a/html/channel.ejs +++ b/html/channel.ejs @@ -688,12 +688,15 @@ height: 100%; <% - function authorVerifiedChecker3000() { - if (tj?.videos && tj.videos.length > 0 && tj.videos[0].authorVerified) return true; - if (shorts?.videos && shorts.videos.length > 0 && shorts.videos[0].authorVerified) return true; - if (stream?.videos && stream.videos.length > 0 && stream.videos[0].authorVerified) return true; - return false; - } +function authorVerifiedChecker3000() { + const sources = [tj, shorts, stream]; + + const hasVerified = (source) => + source?.videos?.[0]?.authorVerified === true; + + return sources.some(hasVerified); +} + %> <% if (authorVerifiedChecker3000()) { %>