2022-06-21 15:08:12 -04:00
|
|
|
import deprecated from "discourse-common/lib/deprecated";
|
|
|
|
|
2020-04-29 12:18:21 -04:00
|
|
|
export const INPUT_DELAY = 250;
|
|
|
|
|
2020-06-01 16:33:43 -04:00
|
|
|
let environment = "unknown";
|
|
|
|
|
|
|
|
export function setEnvironment(e) {
|
|
|
|
if (isTesting()) {
|
|
|
|
environment = "testing";
|
|
|
|
} else {
|
|
|
|
environment = e;
|
|
|
|
}
|
|
|
|
}
|
2020-05-29 12:16:05 -04:00
|
|
|
|
|
|
|
export function isTesting() {
|
2023-03-23 06:27:12 -04:00
|
|
|
return environment === "testing";
|
2020-05-29 12:16:05 -04:00
|
|
|
}
|
|
|
|
|
2021-01-21 15:55:39 -05:00
|
|
|
// Generally means "before we migrated to Ember CLI"
|
|
|
|
export function isLegacyEmber() {
|
2022-10-19 12:04:49 -04:00
|
|
|
deprecated("`isLegacyEmber()` is now deprecated and always returns false", {
|
2022-11-16 05:00:39 -05:00
|
|
|
id: "discourse.is-legacy-ember",
|
2022-06-21 15:08:12 -04:00
|
|
|
dropFrom: "3.0.0.beta1",
|
|
|
|
});
|
2022-10-19 12:04:49 -04:00
|
|
|
return false;
|
2021-01-21 15:55:39 -05:00
|
|
|
}
|
|
|
|
|
2020-06-01 16:33:43 -04:00
|
|
|
export function isDevelopment() {
|
|
|
|
return environment === "development";
|
|
|
|
}
|
|
|
|
|
|
|
|
export function isProduction() {
|
|
|
|
return environment === "production";
|
|
|
|
}
|