Still set username if user is undefined

Fixes "Started 12 hours ago by undefined" on discussion author avatar
tooltip
This commit is contained in:
Toby Zerner 2015-08-05 12:17:36 +09:30
parent 151af395c9
commit ebf57c389e

View File

@ -60,7 +60,7 @@ export default class Translator {
// future there should be a hook here to inspect the user and change the
// translation key. This will allow a gender property to determine which
// translation key is used.
if (input.user instanceof User) {
if ('user' in input) {
const user = extract(input, 'user');
if (!input.username) input.username = username(user);