From 44f05a83afe4523357b7339d8e5f3c39ce83121a Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 21 Oct 2023 04:57:10 +0000 Subject: [PATCH] does this work idk qwq --- src/libpoketube/libpoketube-dislikes.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/libpoketube/libpoketube-dislikes.js b/src/libpoketube/libpoketube-dislikes.js index f65872cb..c2a728c1 100644 --- a/src/libpoketube/libpoketube-dislikes.js +++ b/src/libpoketube/libpoketube-dislikes.js @@ -46,18 +46,14 @@ async _getEngagementData() { const { fetch } = await import("undici"); - - try { - const engagement = await fetch(apiUrl).then((res) => res.json()); - return engagement; - } catch { - try { - const engagement = await fetch(fallbackUrl).then((res) => res.json()); + var engagementP = await fetch(apiUrl).then((res) => res.json()); + + if(!engagementP.dislikes) { + var engagement = await fetch(fallbackUrl).then((res) => res.json()); return engagement; - } catch { - return null; + } else { + return engagementP; } - } }