From 5bbf9cca6d65576608bb8c0e149861e3ff52dc3b Mon Sep 17 00:00:00 2001 From: MarshDeer Date: Fri, 6 Sep 2024 20:34:12 -0400 Subject: [PATCH] added nitter redirection to openTweet() --- static/openInApp.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/openInApp.js b/static/openInApp.js index 4a5b283..85ecac3 100644 --- a/static/openInApp.js +++ b/static/openInApp.js @@ -13,21 +13,21 @@ function detectOS() { } function openTweet(tweetId){ - var preference = localStorage.getItem("openLinksPreference"); - if (preference === "true"){ + if (localStorage.getItem("openLinksPreference") === "true") { const os = detectOS(); - url = `twitter://status?id=${tweetId}` if(os === 'android'){ window.location = url; }else if (os === 'ios'){ window.location.replace(url); } - }else{ + } else if (localStorage.getItem("frontendToggle") === "true" && localStorage.getItem("frontendUrl") !== null) { + window.location = `${frontendUrl}/i/status/${tweetId}` + } else { window.location = `https://x.com/i/status/${tweetId}` } setTimeout(() => { window.location = `https://x.com/i/status/${tweetId}` }, 1000) -} \ No newline at end of file +}