mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
git pull
This commit is contained in:
parent
9ddf304663
commit
b1f876de7c
3 changed files with 8 additions and 4 deletions
|
@ -6,6 +6,7 @@ import {
|
|||
checkForDataFolder,
|
||||
checkIfConfigExists,
|
||||
firstRun,
|
||||
checkIfConfigIsBroken,
|
||||
getConfig,
|
||||
getConfigSync,
|
||||
injectElectronFlags,
|
||||
|
@ -70,7 +71,7 @@ if (!app.requestSingleInstanceLock() && getConfigSync("multiInstance") == (false
|
|||
}
|
||||
// work around chrome 66 disabling autoplay by default
|
||||
app.commandLine.appendSwitch("autoplay-policy", "no-user-gesture-required");
|
||||
|
||||
checkIfConfigIsBroken();
|
||||
// WinRetrieveSuggestionsOnlyOnDemand: Work around electron 13 bug w/ async spellchecking on Windows.
|
||||
// HardwareMediaKeyHandling,MediaSessionService: Prevent Discord from registering as a media service.
|
||||
app.commandLine.appendSwitch(
|
||||
|
|
|
@ -26,7 +26,12 @@ export async function sleep(ms: number): Promise<void> {
|
|||
}
|
||||
|
||||
export async function checkIfConfigIsBroken(): Promise<void> {
|
||||
if ((await getConfig("0")) == "d") {
|
||||
try {
|
||||
let rawdata = fs.readFileSync(getConfigLocation(), "utf-8");
|
||||
JSON.parse(rawdata);
|
||||
console.log("Config is fine");
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
console.log("Detected a corrupted config");
|
||||
setup();
|
||||
dialog.showErrorBox(
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
import {BrowserWindow, MessageBoxOptions, app, dialog, nativeImage, shell} from "electron";
|
||||
import path from "path";
|
||||
import {
|
||||
checkIfConfigIsBroken,
|
||||
contentPath,
|
||||
firstRun,
|
||||
getConfig,
|
||||
|
@ -68,7 +67,6 @@ async function doAfterDefiningTheWindow(): Promise<void> {
|
|||
}
|
||||
}
|
||||
let ignoreProtocolWarning = await getConfig("ignoreProtocolWarning");
|
||||
await checkIfConfigIsBroken();
|
||||
registerIpc();
|
||||
if (await getConfig("mobileMode")) {
|
||||
mainWindow.webContents.userAgent =
|
||||
|
|
Loading…
Reference in a new issue