mirror of
https://github.com/flarum/framework.git
synced 2024-12-01 05:53:45 +08:00
parent
685459c0bc
commit
82480457ce
|
@ -100,25 +100,25 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
const showAlert = type => {
|
||||
const { username, email } = this.data.attributes;
|
||||
|
||||
app.alerts.show(new Alert({
|
||||
type,
|
||||
children: app.translator.trans(
|
||||
`core.forum.user.delete_alert_${type}`, { username, email }
|
||||
)
|
||||
}));
|
||||
};
|
||||
|
||||
this.delete().then(() => {
|
||||
showAlert('success');
|
||||
this.showDeletionAlert('success');
|
||||
if (app.current instanceof UserPage && app.current.user === this) {
|
||||
app.history.back();
|
||||
} else {
|
||||
window.location.reload();
|
||||
}
|
||||
}).catch(() => showAlert('error'));
|
||||
}).catch(() => this.showDeletionAlert('error'));
|
||||
},
|
||||
|
||||
showDeletionAlert(type) {
|
||||
const { username, email } = this.data.attributes;
|
||||
|
||||
app.alerts.show(new Alert({
|
||||
type,
|
||||
children: app.translator.trans(
|
||||
`core.forum.user.delete_alert_${type}`, { username, email }
|
||||
)
|
||||
}));
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user