Components tweak
This commit is contained in:
parent
3c4441e8c5
commit
c51d82271e
1 changed files with 29 additions and 45 deletions
74
index.js
74
index.js
|
@ -2,7 +2,9 @@ require('v8-compile-cache');
|
||||||
const {app, components} = require('electron'),
|
const {app, components} = require('electron'),
|
||||||
{resolve, join} = require("path"),
|
{resolve, join} = require("path"),
|
||||||
CiderBase = require('./src/main/cider-base');
|
CiderBase = require('./src/main/cider-base');
|
||||||
var componentsFail = false;
|
|
||||||
|
const comps = components;
|
||||||
|
|
||||||
// Analytics for debugging.
|
// Analytics for debugging.
|
||||||
const ElectronSentry = require("@sentry/electron");
|
const ElectronSentry = require("@sentry/electron");
|
||||||
ElectronSentry.init({dsn: "https://68c422bfaaf44dea880b86aad5a820d2@o954055.ingest.sentry.io/6112214"});
|
ElectronSentry.init({dsn: "https://68c422bfaaf44dea880b86aad5a820d2@o954055.ingest.sentry.io/6112214"});
|
||||||
|
@ -128,41 +130,40 @@ function CreateWindow() {
|
||||||
if (process.platform === "linux") {
|
if (process.platform === "linux") {
|
||||||
app.commandLine.appendSwitch('disable-features', 'MediaSessionService');
|
app.commandLine.appendSwitch('disable-features', 'MediaSessionService');
|
||||||
}
|
}
|
||||||
|
app.commandLine.appendSwitch('high-dpi-support', "1")
|
||||||
|
app.commandLine.appendSwitch('force-device-scale-factor', "1")
|
||||||
|
app.commandLine.appendSwitch('disable-pinch');
|
||||||
|
// app.commandLine.appendSwitch('js-flags', '--max-old-space-size=1024')
|
||||||
|
|
||||||
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
* App Event Handlers
|
* App Event Handlers
|
||||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
||||||
|
|
||||||
// app.commandLine.appendSwitch('js-flags', '--max-old-space-size=1024')
|
app.whenReady().then(async () => {
|
||||||
|
if (comps == null) {
|
||||||
|
app.on("widevine-ready", () => {
|
||||||
|
console.log('[Cider] Application is Ready. Creating Window.')
|
||||||
|
if (!app.isPackaged) {
|
||||||
|
console.info('[Cider] Running in development mode.')
|
||||||
|
require('vue-devtools').install()
|
||||||
|
}
|
||||||
|
CreateWindow()
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
await comps.whenReady();
|
||||||
|
console.log('components ready:', comps.status());
|
||||||
|
|
||||||
app.on('ready', () => {
|
console.log('[Cider] Application is Ready. Creating Window.')
|
||||||
app.whenReady().then(async () => {
|
if (!app.isPackaged) {
|
||||||
if (components != null) {
|
console.info('[Cider] Running in development mode.')
|
||||||
try{
|
require('vue-devtools').install()
|
||||||
await components.whenReady().catch(e => {console.log(`component ready fail:`, e); componentsFail = true});
|
}
|
||||||
console.log('components ready:', components.status());
|
CreateWindow()
|
||||||
if (app.isQuiting) {
|
})
|
||||||
app.quit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
app.commandLine.appendSwitch('high-dpi-support', 1)
|
|
||||||
app.commandLine.appendSwitch('force-device-scale-factor', 1)
|
|
||||||
app.commandLine.appendSwitch('disable-pinch');
|
|
||||||
|
|
||||||
console.log('[Cider] Application is Ready. Creating Window.')
|
|
||||||
if (!app.isPackaged) {
|
|
||||||
console.info('[Cider] Running in development mode.')
|
|
||||||
require('vue-devtools').install()
|
|
||||||
}
|
|
||||||
CreateWindow()
|
|
||||||
} catch (e) {componentsFail = true}
|
|
||||||
} else {componentsFail = true}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
app.on('before-quit', () => {s
|
app.on('before-quit', () => {
|
||||||
app.isQuiting = true;
|
|
||||||
console.warn(`${app.getName()} exited.`);
|
console.warn(`${app.getName()} exited.`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -173,23 +174,6 @@ app.on('widevine-ready', (version, lastVersion) => {
|
||||||
} else {
|
} else {
|
||||||
console.log('[Cider][Widevine] Widevine ' + version + ' is ready to be used!')
|
console.log('[Cider][Widevine] Widevine ' + version + ' is ready to be used!')
|
||||||
}
|
}
|
||||||
|
|
||||||
if(componentsFail){
|
|
||||||
if (app.isQuiting) {
|
|
||||||
app.quit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
app.commandLine.appendSwitch('high-dpi-support', 1)
|
|
||||||
app.commandLine.appendSwitch('force-device-scale-factor', 1)
|
|
||||||
app.commandLine.appendSwitch('disable-pinch');
|
|
||||||
|
|
||||||
console.log('[Cider] Application is Ready. Creating Window.')
|
|
||||||
if (!app.isPackaged) {
|
|
||||||
console.info('[Cider] Running in development mode.')
|
|
||||||
require('vue-devtools').install()
|
|
||||||
}
|
|
||||||
CreateWindow()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('widevine-update-pending', (currentVersion, pendingVersion) => {
|
app.on('widevine-update-pending', (currentVersion, pendingVersion) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue