Replace username with display name in more places (#3040)

* Replace username with display name in more places

* More readable spread operator and translator user magic
This commit is contained in:
Clark Winkelmann
2021-08-22 00:34:34 +02:00
committed by GitHub
parent af89b23f67
commit aba6836bdd
3 changed files with 9 additions and 4 deletions

View File

@ -124,13 +124,18 @@ export default {
* @param {string} type
*/
showDeletionAlert(user, type) {
const { username, email } = user.data.attributes;
const message = {
success: 'core.forum.user_controls.delete_success_message',
error: 'core.forum.user_controls.delete_error_message',
}[type];
app.alerts.show({ type }, app.translator.trans(message, { username, email }));
app.alerts.show(
{ type },
app.translator.trans(message, {
user,
email: user.email(),
})
);
},
/**