From 69ba89518a5c497a87499a0ed700da49139cb636 Mon Sep 17 00:00:00 2001 From: Bilge Date: Sun, 21 Apr 2024 12:20:06 +0100 Subject: [PATCH] Added support for hiding obsolete tiers on Club 250. --- assets/js/250.ts | 8 +++++++- assets/js/User.ts | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/assets/js/250.ts b/assets/js/250.ts index b925ae201cc..2e5f8754e98 100644 --- a/assets/js/250.ts +++ b/assets/js/250.ts @@ -208,6 +208,10 @@ class S250 { return User.isLoggedIn(); } + static isClub250() { + return location.origin === process.env.CLUB_250_BASE_URL; + } + static syncLogin() { return User.syncLogin(); } @@ -375,5 +379,7 @@ class S250 { document.body.removeChild(textarea); } } -} new S250; +} + window.S250 = S250; +new S250; diff --git a/assets/js/User.ts b/assets/js/User.ts index b3aa2235449..3491ea85948 100644 --- a/assets/js/User.ts +++ b/assets/js/User.ts @@ -71,10 +71,12 @@ export default class User { static syncLoginUi() { if (this.isLoggedIn()) { this.rewireTagLinks(); + this.hideObsoleteTiers(); } + if (S250.isClub250()) return; + const userBar = document.getElementById('user'); - // Anything beyond this point will not run on Club 250. if (!userBar) return; const classes = userBar.classList; @@ -83,7 +85,6 @@ export default class User { if (this.isLoggedIn()) { this.updateUserBar(); - this.hideObsoleteTiers(); } }