mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
FIX: addPosterIcon wasn't working on initial load
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user