FIX: `decoratorHelper.widget` is not always present

This commit is contained in:
Robin Ward 2019-04-05 12:07:24 -04:00
parent acce7330a3
commit b005a84530
1 changed files with 8 additions and 2 deletions

View File

@ -16,8 +16,14 @@ export default class PostCooked {
this.attrs = attrs;
this.expanding = false;
this._highlighted = false;
this.decoratorHelper = decoratorHelper;
this.currentUser = decoratorHelper.widget.currentUser;
if (decoratorHelper) {
this.decoratorHelper = decoratorHelper;
if (decoratorHelper.widget && decoratorHelper.currentUser) {
this.currentUser = decoratorHelper.currentUser;
}
}
this.ignoredUsers = this.currentUser
? this.currentUser.ignored_users
: null;