Remove discourse constants (#9958)

* DEV: `Discourse.baseUri` does not exist

This never could have worked - should have been `Discourse.BaseUri` if
anything.

* DEV: Remove Discourse.Environment

* DEV: Remove `Discourse.disableMissingIconWarning`

* DEV: A bunch more missing environment checks
This commit is contained in:
Robin Ward
2020-06-01 16:33:43 -04:00
committed by GitHub
parent 9162cd8f3d
commit a95826f60c
26 changed files with 92 additions and 62 deletions

View File

@@ -2,7 +2,12 @@ import MultiSelectComponent from "select-kit/components/multi-select";
import { computed } from "@ember/object";
import { ajax } from "discourse/lib/ajax";
import { makeArray } from "discourse-common/lib/helpers";
import { convertIconClass } from "discourse-common/lib/icon-library";
import {
convertIconClass,
disableMissingIconWarning,
enableMissingIconWarning
} from "discourse-common/lib/icon-library";
import { isDevelopment } from "discourse-common/config/environment";
export default MultiSelectComponent.extend({
pluginApiIdentifiers: ["icon-picker"],
@@ -13,8 +18,8 @@ export default MultiSelectComponent.extend({
this._cachedIconsList = null;
if (Discourse.Environment === "development") {
Discourse.disableMissingIconWarning = true;
if (isDevelopment()) {
disableMissingIconWarning();
}
},
@@ -75,8 +80,8 @@ export default MultiSelectComponent.extend({
this._cachedIconsList = null;
if (Discourse.Environment === "development") {
delete Discourse.disableMissingIconWarning;
if (isDevelopment()) {
enableMissingIconWarning();
}
},