Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 34 additions & 26 deletions src/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { app, session } = require('electron');
const { app, session, dialog } = require('electron');
const { readFileSync } = require('fs');
const { join } = require('path');

Expand Down Expand Up @@ -48,31 +48,39 @@ const startCore = () => {
if (oaConfig.js) bw.webContents.executeJavaScript(oaConfig.js);
});
});

desktopCore = require('discord_desktop_core');

desktopCore.startup({
splashScreen: splash,
moduleUpdater,
buildInfo,
Constants,
updater,
autoStart,

// Just requires
appSettings: require('./appSettings'),
paths: require('./paths'),

// Stubs
GPUSettings: {
replace: () => {}
},
crashReporterSetup: {
isInitialized: () => true,
getGlobalSentry: () => null,
metadata: {}
}
});
try {
desktopCore = require('discord_desktop_core');

desktopCore.startup({
splashScreen: splash,
moduleUpdater,
buildInfo,
Constants,
updater,
autoStart,

// Just requires
appSettings: require('./appSettings'),
paths: require('./paths'),

// Stubs
GPUSettings: {
replace: () => {}
},
crashReporterSetup: {
isInitialized: () => true,
getGlobalSentry: () => null,
metadata: {}
}
});
} catch (e) {
dialog.showMessageBox({
title: "Discord Crashed",
type: "error",
message: e.code ? e.code : "Something crashed your Discord Client",
detail: e && e.stack ? e.stack : String(e)
}).then(app.quit);
}
};

const startUpdate = () => {
Expand Down