various bug fixes
This commit is contained in:
parent
739ee81002
commit
d0d6ff8448
4 changed files with 26 additions and 5 deletions
|
@ -1702,9 +1702,16 @@ class Localuser {
|
|||
{
|
||||
const deleteAccount = settings.addButton(I18n.localuser.deleteAccount()).addForm(
|
||||
"",
|
||||
() => {
|
||||
this.userinfo.remove();
|
||||
window.location.href = "/";
|
||||
(e) => {
|
||||
console.log(e);
|
||||
if ("message" in e) {
|
||||
if (typeof e.message === "string") {
|
||||
throw new FormError(password, e.message);
|
||||
}
|
||||
} else {
|
||||
this.userinfo.remove();
|
||||
window.location.href = "/";
|
||||
}
|
||||
},
|
||||
{
|
||||
headers: this.headers,
|
||||
|
@ -1718,7 +1725,7 @@ class Localuser {
|
|||
I18n.localuser.areYouSureDelete(I18n.localuser.sillyDeleteConfirmPhrase()),
|
||||
"shrek",
|
||||
);
|
||||
deleteAccount.addTextInput(I18n.localuser["password:"](), "password");
|
||||
const password = deleteAccount.addTextInput(I18n.localuser["password:"](), "password");
|
||||
deleteAccount.addPreprocessor((obj) => {
|
||||
if ("shrek" in obj) {
|
||||
if (obj.shrek !== I18n.localuser.sillyDeleteConfirmPhrase()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue