mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Add potential workarounds for renderer crash
This commit is contained in:
parent
a531d4e30f
commit
5aefe765ec
4 changed files with 59 additions and 46 deletions
|
@ -21,6 +21,11 @@ import {createSplashWindow} from "./splash/main";
|
||||||
export let iconPath: string;
|
export let iconPath: string;
|
||||||
export let settings: any;
|
export let settings: any;
|
||||||
export let customTitlebar: boolean;
|
export let customTitlebar: boolean;
|
||||||
|
app.on("render-process-gone", (event, webContents, details) => {
|
||||||
|
if (details.reason == "crashed") {
|
||||||
|
app.relaunch();
|
||||||
|
}
|
||||||
|
});
|
||||||
async function args(): Promise<void> {
|
async function args(): Promise<void> {
|
||||||
let argNum = 2;
|
let argNum = 2;
|
||||||
if (process.argv[0] == "electron") argNum++;
|
if (process.argv[0] == "electron") argNum++;
|
||||||
|
|
|
@ -54,6 +54,7 @@ export function createSettingsWindow(): void {
|
||||||
fs.writeFileSync(path.join(userDataPath, "/disabled.txt"), "");
|
fs.writeFileSync(path.join(userDataPath, "/disabled.txt"), "");
|
||||||
}
|
}
|
||||||
settingsWindow.webContents.on("did-finish-load", () => {
|
settingsWindow.webContents.on("did-finish-load", () => {
|
||||||
|
if (!settingsWindow.webContents.isLoading()) {
|
||||||
fs.readdirSync(themesFolder).forEach((file) => {
|
fs.readdirSync(themesFolder).forEach((file) => {
|
||||||
try {
|
try {
|
||||||
const manifest = fs.readFileSync(`${themesFolder}/${file}/manifest.json`, "utf8");
|
const manifest = fs.readFileSync(`${themesFolder}/${file}/manifest.json`, "utf8");
|
||||||
|
@ -67,6 +68,7 @@ export function createSettingsWindow(): void {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
ipcMain.on("saveSettings", (_event, args: Settings) => {
|
ipcMain.on("saveSettings", (_event, args: Settings) => {
|
||||||
console.log(args);
|
console.log(args);
|
||||||
|
|
|
@ -195,6 +195,7 @@ export function createTManagerWindow(): void {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
themeWindow.webContents.on("did-finish-load", () => {
|
themeWindow.webContents.on("did-finish-load", () => {
|
||||||
|
if (!themeWindow.webContents.isLoading()) {
|
||||||
fs.readdirSync(themesFolder).forEach((file) => {
|
fs.readdirSync(themesFolder).forEach((file) => {
|
||||||
try {
|
try {
|
||||||
const manifest = fs.readFileSync(`${themesFolder}/${file}/manifest.json`, "utf8");
|
const manifest = fs.readFileSync(`${themesFolder}/${file}/manifest.json`, "utf8");
|
||||||
|
@ -203,6 +204,7 @@ export function createTManagerWindow(): void {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
managerLoadPage();
|
managerLoadPage();
|
||||||
|
|
|
@ -198,6 +198,7 @@ async function doAfterDefiningTheWindow(): Promise<void> {
|
||||||
fs.writeFileSync(path.join(userDataPath, "/disabled.txt"), "");
|
fs.writeFileSync(path.join(userDataPath, "/disabled.txt"), "");
|
||||||
}
|
}
|
||||||
mainWindow.webContents.on("did-finish-load", () => {
|
mainWindow.webContents.on("did-finish-load", () => {
|
||||||
|
if (!mainWindow.webContents.isLoading()) {
|
||||||
fs.readdirSync(themesFolder).forEach((file) => {
|
fs.readdirSync(themesFolder).forEach((file) => {
|
||||||
try {
|
try {
|
||||||
const manifest = fs.readFileSync(`${themesFolder}/${file}/manifest.json`, "utf8");
|
const manifest = fs.readFileSync(`${themesFolder}/${file}/manifest.json`, "utf8");
|
||||||
|
@ -220,6 +221,7 @@ async function doAfterDefiningTheWindow(): Promise<void> {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
await setMenu();
|
await setMenu();
|
||||||
mainWindow.on("close", async (e) => {
|
mainWindow.on("close", async (e) => {
|
||||||
|
@ -370,9 +372,11 @@ export async function createInviteWindow(code: string): Promise<void> {
|
||||||
});
|
});
|
||||||
inviteWindow.loadURL(formInviteURL);
|
inviteWindow.loadURL(formInviteURL);
|
||||||
inviteWindow.webContents.once("did-finish-load", () => {
|
inviteWindow.webContents.once("did-finish-load", () => {
|
||||||
|
if (!mainWindow.webContents.isLoading()) {
|
||||||
inviteWindow.show();
|
inviteWindow.show();
|
||||||
inviteWindow.webContents.once("will-navigate", () => {
|
inviteWindow.webContents.once("will-navigate", () => {
|
||||||
inviteWindow.close();
|
inviteWindow.close();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue