Updated portal preview to use default icon
refs https://github.com/TryGhost/members.js/issues/77 - By default, if there is no icon button selected, we fallback to show the first icon in list as selected in both preview and portal
This commit is contained in:
parent
edad489d56
commit
aa6e138e5c
|
@ -136,6 +136,9 @@ export default ModalComponent.extend({
|
|||
this.iconExtensions = ICON_EXTENSIONS;
|
||||
const portalButtonIcon = this.settings.get('portalButtonIcon') || '';
|
||||
const defaultIconKeys = this.defaultButtonIcons.map(buttonIcon => buttonIcon.value);
|
||||
if (!portalButtonIcon) {
|
||||
this.set('buttonIcon', defaultIconKeys[0]);
|
||||
}
|
||||
if (portalButtonIcon && !defaultIconKeys.includes(portalButtonIcon)) {
|
||||
this.set('customIcon', this.settings.get('portalButtonIcon'));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue