mirror of
https://github.com/flarum/framework.git
synced 2025-03-11 21:05:25 +08:00
parent
c3740281b6
commit
e7cdd497dd
@ -100,7 +100,17 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const showAlert = type => {
|
this.delete().then(() => {
|
||||||
|
this.showDeletionAlert('success');
|
||||||
|
if (app.current instanceof UserPage && app.current.user === this) {
|
||||||
|
app.history.back();
|
||||||
|
} else {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
}).catch(() => this.showDeletionAlert('error'));
|
||||||
|
},
|
||||||
|
|
||||||
|
showDeletionAlert(type) {
|
||||||
const { username, email } = this.data.attributes;
|
const { username, email } = this.data.attributes;
|
||||||
|
|
||||||
app.alerts.show(new Alert({
|
app.alerts.show(new Alert({
|
||||||
@ -109,16 +119,6 @@ export default {
|
|||||||
`core.forum.user.delete_alert_${type}`, { username, email }
|
`core.forum.user.delete_alert_${type}`, { username, email }
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
};
|
|
||||||
|
|
||||||
this.delete().then(() => {
|
|
||||||
showAlert('success');
|
|
||||||
if (app.current instanceof UserPage && app.current.user === this) {
|
|
||||||
app.history.back();
|
|
||||||
} else {
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
}).catch(() => showAlert('error'));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user