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