feat: add better debugging flags

This commit is contained in:
Paul Makles 2022-01-02 15:33:58 +00:00
parent bdb1d939e7
commit a688063d96
2 changed files with 6 additions and 1 deletions

View file

@ -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) {

View file

@ -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;
}