updated settings class and user can now remove pfp

This commit is contained in:
MathMan05 2024-08-22 15:06:45 -05:00
parent 39f7a3701a
commit e11cd2e0c1
10 changed files with 537 additions and 72 deletions

View file

@ -814,8 +814,16 @@ class Localuser {
if (file) {
this.updatepfp(file);
}
});
}, { clear: true });
finput.watchForChange(_ => {
if (!_) {
file = _;
hypouser.avatar = null;
hypouser.hypotheticalpfp = true;
regen();
return;
}
;
if (_.length) {
file = _[0];
const blob = URL.createObjectURL(file);
@ -829,8 +837,15 @@ class Localuser {
if (bfile !== undefined) {
this.updatebanner(bfile);
}
});
}, { clear: true });
binput.watchForChange(_ => {
if (!_) {
bfile = null;
hypouser.banner = undefined;
hypouser.hypotheticalbanner = true;
regen();
return;
}
if (_.length) {
bfile = _[0];
const blob = URL.createObjectURL(bfile);
@ -839,12 +854,6 @@ class Localuser {
regen();
}
});
const bclear = settingsLeft.addButtonInput("Clear banner", "Clear", () => {
bfile = null;
hypouser.banner = undefined;
settingsLeft.changed();
regen();
});
let changed = false;
const pronounbox = settingsLeft.addTextInput("Pronouns", _ => {
if (newpronouns || newbio || changed) {