Skip to content

Commit

Permalink
Added support for hiding obsolete tiers on Club 250.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilge committed Apr 21, 2024
1 parent ed20899 commit 69ba895
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion assets/js/250.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -375,5 +379,7 @@ class S250 {
document.body.removeChild(textarea);
}
}
} new S250;
}

window.S250 = S250;
new S250;
5 changes: 3 additions & 2 deletions assets/js/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -83,7 +85,6 @@ export default class User {

if (this.isLoggedIn()) {
this.updateUserBar();
this.hideObsoleteTiers();
}
}

Expand Down

0 comments on commit 69ba895

Please sign in to comment.