diff --git a/src/webpage/index.ts b/src/webpage/index.ts index 26722c2..13cbd98 100644 --- a/src/webpage/index.ts +++ b/src/webpage/index.ts @@ -86,7 +86,9 @@ if (window.location.pathname.startsWith("/channels")) { regSwap(thisUser); thisUser.initwebsocket().then(async () => { thisUser.loaduser(); + console.warn("huh"); await thisUser.init(); + console.warn("huh2"); const loading = document.getElementById("loading") as HTMLDivElement; loading.classList.add("doneloading"); loading.classList.remove("loading"); diff --git a/src/webpage/localuser.ts b/src/webpage/localuser.ts index f00e98d..156a068 100644 --- a/src/webpage/localuser.ts +++ b/src/webpage/localuser.ts @@ -530,7 +530,9 @@ class Localuser { const temp = JSON.parse(build); build = ""; await this.handleEvent(temp); + if (temp.op === 0 && temp.t === "READY") { + console.log("in here?"); returny(); } } catch {} @@ -662,6 +664,7 @@ class Localuser { if (this.swapped) return; loaddesc.textContent = I18n.retrying(); this.initwebsocket().then(async () => { + console.log("FINE ME"); this.loaduser(); await this.init(); const loading = document.getElementById("loading") as HTMLElement; @@ -675,7 +678,9 @@ class Localuser { ); } else loaddesc.textContent = I18n.unableToConnect(); }); + console.log("here?"); await promise; + console.warn("huh"); } interNonceMap = new Map(); registerInterNonce(nonce: string, thing: Message) { @@ -2860,6 +2865,14 @@ class Localuser { }, {initState: !this.perminfo.user.disableColors}, ); + accessibility.addCheckboxInput( + I18n.accessibility.gradientColors(), + (t) => { + console.log(t); + this.perminfo.user.gradientColors = t; + }, + {initState: this.perminfo.user.gradientColors}, + ); accessibility.addCheckboxInput( I18n.channel.allowIcons(), (t) => { diff --git a/src/webpage/role.ts b/src/webpage/role.ts index 4de32d3..62e6dcf 100644 --- a/src/webpage/role.ts +++ b/src/webpage/role.ts @@ -28,6 +28,7 @@ class Role extends SnowFlake { }; constructor(json: rolesjson, owner: Guild) { super(json.id); + this.headers = owner.headers; this.info = owner.info; for (const thing of Object.keys(json)) { @@ -36,9 +37,9 @@ class Role extends SnowFlake { } (this as any)[thing] = (json as any)[thing]; } - this.roleLoad(); this.permissions = new Permissions(json.permissions); this.owner = owner; + this.roleLoad(); } getIcon(): HTMLElement | void { const hover = new Hover(this.name); @@ -57,10 +58,11 @@ class Role extends SnowFlake { } } getColorStyle(short = false) { + const grad = this.localuser.perminfo?.user?.gradientColors as boolean; const [len1, len2, len3] = short ? (["", "", ""] as const) : (["30px", "60px", "90px"] as const); - if (this.colors) { + if (this.colors && !grad) { const prim = this.getColor(); if (this.colors.secondary_color) { const second = Role.numberToColor(this.colors.secondary_color); diff --git a/translations/en.json b/translations/en.json index dcb6d83..84d6840 100644 --- a/translations/en.json +++ b/translations/en.json @@ -55,7 +55,8 @@ "name": "Accessibility", "playGif": "Play gifs on:", "playIcon": "Play animated icons on:", - "roleColors": "Disable role colors" + "roleColors": "Disable role colors", + "gradientColors":"Disable gradient colors" }, "accountNotStart": "Account unable to start", "add": "Add",