DEV: Allow us to keep the deprecation with Ember CLI

This commit is contained in:
Robin Ward 2020-05-11 16:06:06 -04:00
parent 4c17ff98fa
commit 46730a2f0d

View File

@ -216,18 +216,20 @@ Site.reopenClass(Singleton, {
} }
}); });
let warned = false; if (typeof Discourse !== "undefined") {
Object.defineProperty(Discourse, "Site", { let warned = false;
get() { Object.defineProperty(Discourse, "Site", {
if (!warned) { get() {
deprecated("Import the Site class instead of using Discourse.Site", { if (!warned) {
since: "2.4.0", deprecated("Import the Site class instead of using Discourse.Site", {
dropFrom: "2.6.0" since: "2.4.0",
}); dropFrom: "2.6.0"
warned = true; });
warned = true;
}
return Site;
} }
return Site; });
} }
});
export default Site; export default Site;