Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit e4c6ee8

Browse files
Config Updating Bug Fixes
A few bug fixes around updating the configuration from a previous versions of the application. The window would not relaunch and there was some unfinished code I did not want pushed in this update that has been disabled.
1 parent cdc948c commit e4c6ee8

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ npm start
7474

7575
# TODO
7676

77-
- Auto Restarting The Player Not Working On Linux - Maybe Resort to Old Slow Way
7877
- Updated Electron Widevine
7978
- Update All DEPS
8079
- Add Tests

src/main.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,15 @@ function createWindow() {
8383
// This provides a method for updating the configuration over time
8484
if (store.get('version') === app.getVersion()) {
8585
// Update Not Required For Client
86-
} else if (
87-
store.get('version') === '2.0.4' && // TODO: Allow this to be automatic and work again for future releases
88-
store.get('services').length === 4
89-
) {
90-
// Automatic Config Update
91-
store.set('services', require('./default-services'));
92-
store.set('version', app.getVersion());
93-
console.log('Automatically updated default services in your config');
86+
// TODO: Make this automatic detection and updating more stable then release
87+
// } else if (
88+
// store.get('version') === '2.0.4' && // TODO: Allow this to be automatic and work again for future releases
89+
// store.get('services').length === 4
90+
// ) {
91+
// // Automatic Config Update
92+
// store.set('services', require('./default-services'));
93+
// store.set('version', app.getVersion());
94+
// console.log('Automatically updated default services in your config');
9495
} else {
9596
// Manual Config Update
9697
let options = {
@@ -110,7 +111,6 @@ function createWindow() {
110111
if (response == 0) {
111112
store.clear();
112113
app.emit('relaunch');
113-
app.exit();
114114
console.log('Reset Configuration and Restarting Electron');
115115
return;
116116
} else {
@@ -174,7 +174,10 @@ function broswerWindowDomReady() {
174174
store.get('options.pictureInPicture') ||
175175
store.get('options.hideWindowFrame')
176176
) {
177-
mainWindow.webContents.executeJavaScript(headerScript);
177+
// TODO: This is a temp fix and a propper fix should be developed
178+
if (mainWindow != null) {
179+
mainWindow.webContents.executeJavaScript(headerScript);
180+
}
178181
}
179182
}
180183

@@ -191,7 +194,9 @@ app.on('relaunch', () => {
191194
console.log('Relaunching The Application!');
192195

193196
// Store details to remeber when relaunched
194-
store.set('relaunch.toPage', mainWindow.webContents.getURL());
197+
if (mainWindow.webContents.getURL() != '') {
198+
store.set('relaunch.toPage', mainWindow.webContents.getURL());
199+
}
195200
store.set('relaunch.windowDetails', {
196201
position: mainWindow.getPosition(),
197202
size: mainWindow.getSize()

0 commit comments

Comments
 (0)