mirror of
https://github.com/flarum/framework.git
synced 2025-03-11 04:35:16 +08:00
parent
c3740281b6
commit
e7cdd497dd
@ -100,25 +100,25 @@ export default {
|
|||||||
return;
|
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(() => {
|
this.delete().then(() => {
|
||||||
showAlert('success');
|
this.showDeletionAlert('success');
|
||||||
if (app.current instanceof UserPage && app.current.user === this) {
|
if (app.current instanceof UserPage && app.current.user === this) {
|
||||||
app.history.back();
|
app.history.back();
|
||||||
} else {
|
} else {
|
||||||
window.location.reload();
|
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…
x
Reference in New Issue
Block a user