mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Fix setup not starting up
This commit is contained in:
parent
05395f7c71
commit
ba27104be6
4 changed files with 14 additions and 4 deletions
|
@ -5,11 +5,14 @@ import {
|
|||
Settings,
|
||||
checkForDataFolder,
|
||||
checkIfConfigExists,
|
||||
firstRun,
|
||||
getConfig,
|
||||
injectElectronFlags,
|
||||
installModLoader,
|
||||
modInstallState,
|
||||
setConfig,
|
||||
setLang,
|
||||
setWindowState,
|
||||
sleep
|
||||
} from "./utils";
|
||||
import "./extensions/mods";
|
||||
|
@ -18,6 +21,7 @@ import {createCustomWindow, createNativeWindow, createTransparentWindow, mainWin
|
|||
import path from "path";
|
||||
import {createTManagerWindow} from "./themeManager/main";
|
||||
import {createSplashWindow} from "./splash/main";
|
||||
import {createSetupWindow} from "./setup/main";
|
||||
export let iconPath: string;
|
||||
export let settings: any;
|
||||
export let customTitlebar: boolean;
|
||||
|
@ -93,6 +97,10 @@ if (!app.requestSingleInstanceLock()) {
|
|||
if ((await getConfig("skipSplash")) == false) {
|
||||
createSplashWindow();
|
||||
}
|
||||
if (firstRun == true) {
|
||||
await setLang(new Intl.DateTimeFormat().resolvedOptions().locale);
|
||||
createSetupWindow();
|
||||
}
|
||||
switch (await getConfig("windowStyle")) {
|
||||
case "default":
|
||||
createCustomWindow();
|
||||
|
|
|
@ -136,6 +136,7 @@
|
|||
automaticPatches: false,
|
||||
mobileMode: false,
|
||||
spellcheck: true,
|
||||
skipSplash: false,
|
||||
disableAutogain: false,
|
||||
mods: options.mod,
|
||||
dynamicIcon: false,
|
||||
|
@ -145,7 +146,8 @@
|
|||
alternativePaste: false,
|
||||
performanceMode: "none",
|
||||
trayIcon: "default",
|
||||
inviteWebsocket: true
|
||||
inviteWebsocket: true,
|
||||
doneSetup: true
|
||||
});
|
||||
setTimeout(() => window.armcordinternal.restart(), 500);
|
||||
});
|
||||
|
|
|
@ -222,9 +222,11 @@ export async function getWindowState<K extends keyof WindowState>(object: K): Pr
|
|||
const userDataPath = app.getPath("userData");
|
||||
const storagePath = path.join(userDataPath, "/storage/");
|
||||
const settingsFile = `${storagePath}window.json`;
|
||||
if (!fs.existsSync(settingsFile)) {
|
||||
fs.writeFileSync(settingsFile, "{}", "utf-8");
|
||||
}
|
||||
let rawdata = fs.readFileSync(settingsFile, "utf-8");
|
||||
let returndata = JSON.parse(rawdata);
|
||||
console.log(returndata);
|
||||
console.log(`[Window state manager] ${returndata}`);
|
||||
return returndata[object];
|
||||
}
|
||||
|
|
|
@ -261,8 +261,6 @@ async function doAfterDefiningTheWindow(): Promise<void> {
|
|||
//await startServer();
|
||||
}
|
||||
if (firstRun) {
|
||||
await setLang(new Intl.DateTimeFormat().resolvedOptions().locale);
|
||||
createSetupWindow();
|
||||
mainWindow.close();
|
||||
}
|
||||
mainWindow.loadURL("data:text/html,%3Ch1%3ELoading%21%3C%2Fh1%3E");
|
||||
|
|
Loading…
Reference in a new issue