Skip to content

Commit bf66d53

Browse files
committed
disable gradient colors setting
1 parent 84b54b1 commit bf66d53

4 files changed

Lines changed: 21 additions & 3 deletions

File tree

src/webpage/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ if (window.location.pathname.startsWith("/channels")) {
8686
regSwap(thisUser);
8787
thisUser.initwebsocket().then(async () => {
8888
thisUser.loaduser();
89+
console.warn("huh");
8990
await thisUser.init();
91+
console.warn("huh2");
9092
const loading = document.getElementById("loading") as HTMLDivElement;
9193
loading.classList.add("doneloading");
9294
loading.classList.remove("loading");

src/webpage/localuser.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,9 @@ class Localuser {
530530
const temp = JSON.parse(build);
531531
build = "";
532532
await this.handleEvent(temp);
533+
533534
if (temp.op === 0 && temp.t === "READY") {
535+
console.log("in here?");
534536
returny();
535537
}
536538
} catch {}
@@ -662,6 +664,7 @@ class Localuser {
662664
if (this.swapped) return;
663665
loaddesc.textContent = I18n.retrying();
664666
this.initwebsocket().then(async () => {
667+
console.log("FINE ME");
665668
this.loaduser();
666669
await this.init();
667670
const loading = document.getElementById("loading") as HTMLElement;
@@ -675,7 +678,9 @@ class Localuser {
675678
);
676679
} else loaddesc.textContent = I18n.unableToConnect();
677680
});
681+
console.log("here?");
678682
await promise;
683+
console.warn("huh");
679684
}
680685
interNonceMap = new Map<string, Message>();
681686
registerInterNonce(nonce: string, thing: Message) {
@@ -2860,6 +2865,14 @@ class Localuser {
28602865
},
28612866
{initState: !this.perminfo.user.disableColors},
28622867
);
2868+
accessibility.addCheckboxInput(
2869+
I18n.accessibility.gradientColors(),
2870+
(t) => {
2871+
console.log(t);
2872+
this.perminfo.user.gradientColors = t;
2873+
},
2874+
{initState: this.perminfo.user.gradientColors},
2875+
);
28632876
accessibility.addCheckboxInput(
28642877
I18n.channel.allowIcons(),
28652878
(t) => {

src/webpage/role.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Role extends SnowFlake {
2828
};
2929
constructor(json: rolesjson, owner: Guild) {
3030
super(json.id);
31+
3132
this.headers = owner.headers;
3233
this.info = owner.info;
3334
for (const thing of Object.keys(json)) {
@@ -36,9 +37,9 @@ class Role extends SnowFlake {
3637
}
3738
(this as any)[thing] = (json as any)[thing];
3839
}
39-
this.roleLoad();
4040
this.permissions = new Permissions(json.permissions);
4141
this.owner = owner;
42+
this.roleLoad();
4243
}
4344
getIcon(): HTMLElement | void {
4445
const hover = new Hover(this.name);
@@ -57,10 +58,11 @@ class Role extends SnowFlake {
5758
}
5859
}
5960
getColorStyle(short = false) {
61+
const grad = this.localuser.perminfo?.user?.gradientColors as boolean;
6062
const [len1, len2, len3] = short
6163
? (["", "", ""] as const)
6264
: (["30px", "60px", "90px"] as const);
63-
if (this.colors) {
65+
if (this.colors && !grad) {
6466
const prim = this.getColor();
6567
if (this.colors.secondary_color) {
6668
const second = Role.numberToColor(this.colors.secondary_color);

translations/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
"name": "Accessibility",
5656
"playGif": "Play gifs on:",
5757
"playIcon": "Play animated icons on:",
58-
"roleColors": "Disable role colors"
58+
"roleColors": "Disable role colors",
59+
"gradientColors":"Disable gradient colors"
5960
},
6061
"accountNotStart": "Account unable to start",
6162
"add": "Add",

0 commit comments

Comments
 (0)