mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-11 06:26:25 -04:00
FIX: addPosterIcon wasn't working on initial load
This commit is contained in:
parent
1481b3420e
commit
514d6ede0e
1 changed files with 4 additions and 3 deletions
|
@ -75,12 +75,13 @@ class PluginApi {
|
|||
* ```
|
||||
**/
|
||||
addPosterIcon(cb) {
|
||||
const mobileView = this.container.lookup('site:main').mobileView;
|
||||
const loc = mobileView ? 'before' : 'after';
|
||||
const site = this.container.lookup('site:main');
|
||||
const loc = site && site.mobileView ? 'before' : 'after';
|
||||
|
||||
decorateWidget(`poster-name:${loc}`, dec => {
|
||||
const attrs = dec.attrs;
|
||||
|
||||
const result = cb(attrs.userCustomFields || {}, attrs);
|
||||
|
||||
if (result) {
|
||||
let iconBody;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue