diff --git a/src/mobx/stores/ServerConfig.ts b/src/mobx/stores/ServerConfig.ts index 53fccce2..aa950f03 100644 --- a/src/mobx/stores/ServerConfig.ts +++ b/src/mobx/stores/ServerConfig.ts @@ -3,6 +3,7 @@ import { RevoltConfiguration } from "revolt-api/types/Core"; import { Client } from "revolt.js"; import { Nullable } from "revolt.js/dist/util/null"; +import { isDebug } from "../../revision"; import Persistent from "../interfaces/Persistent"; import Store from "../interfaces/Store"; @@ -44,7 +45,7 @@ export default class ServerConfig unreads: true, autoReconnect: false, apiURL: import.meta.env.VITE_API_URL, - debug: import.meta.env.DEV, + debug: isDebug(), }); if (this.config !== null) { diff --git a/src/revision.ts b/src/revision.ts index e956dfd9..93402bf7 100644 --- a/src/revision.ts +++ b/src/revision.ts @@ -4,3 +4,7 @@ export const REPO_URL: string = "https://github.com/revoltchat/revite/commit"; export const GIT_REVISION: string = "__GIT_REVISION__"; export const GIT_BRANCH: string = "__GIT_BRANCH__"; + +export function isDebug() { + return import.meta.env.FORCE_DEBUG === "1" || import.meta.env.DEV; +}