fix: canonical user

This commit is contained in:
cha0s 2020-12-11 09:07:00 -06:00
parent 2e3049d8e2
commit bb666f7353

View File

@ -27,9 +27,14 @@ export default class Chat extends Model {
return thing;
}
// eslint-disable-next-line camelcase
const {data: {display_name}} = await fetch(`https://old.reddit.com${rendered}/about.json`)
const {data} = await fetch(`https://old.reddit.com${rendered}/about.json`)
.then((response) => response.json());
return this.create({name: renderChannel({...channel, name: display_name})});
return this.create({
name: renderChannel({
...channel,
name: data.display_name || data.name,
}),
});
}
}