FIX: Refactor broke wizard

This commit is contained in:
Robin Ward 2020-08-17 16:33:57 -04:00
parent 2567bb4a67
commit e2e51ee348
3 changed files with 10 additions and 7 deletions

View File

@ -1,12 +1,12 @@
import I18n from "I18n";
import { h } from "virtual-dom";
import attributeHook from "discourse-common/lib/attribute-hook";
import Session from "discourse/models/session";
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
let _renderers = [];
let warnMissingIcons = true;
let _iconList;
const REPLACEMENTS = {
"d-tracking": "bell",
@ -110,12 +110,13 @@ function iconClasses(icon, params) {
return classNames;
}
export function setIconList(iconList) {
_iconList = iconList;
}
function warnIfMissing(id) {
if (warnMissingIcons) {
let iconList = Session.currentProp("svgIconList");
if (iconList && iconList.indexOf(id) === -1) {
console.warn(`The icon "${id}" is missing from the SVG subset.`); // eslint-disable-line no-console
}
if (warnMissingIcons && _iconList && _iconList.indexOf(id) === -1) {
console.warn(`The icon "${id}" is missing from the SVG subset.`); // eslint-disable-line no-console
}
}

View File

@ -10,6 +10,7 @@ import {
} from "discourse-common/config/environment";
import { setupURL, setupS3CDN } from "discourse-common/lib/get-url";
import deprecated from "discourse-common/lib/deprecated";
import { setIconList } from "discourse-common/lib/icon-library";
export default {
name: "discourse-bootstrap",
@ -100,7 +101,7 @@ export default {
Session.currentProp("svgSpritePath", setupData.svgSpritePath);
if (isDevelopment()) {
Session.currentProp("svgIconList", setupData.svgIconList);
setIconList(setupData.svgIconList);
}
if (setupData.s3BaseUrl) {

View File

@ -2,6 +2,7 @@ import { loadSprites } from "discourse/lib/svg-sprite-loader";
export default {
name: "svg-sprite-fontawesome",
after: "discourse-bootstrap",
initialize(container) {
let session = container.lookup("session:main");