Skip to content

Commit 104e2a4

Browse files
Upgrade electron dependancies (#2895)
Resolves #2886 Resolves #2905 This upgrades the Electron and Electron Builder dependencies. The updates introduced three issues: Logging out wouldn't refresh to the login screen. Linux build wouldn't render properly, only had a white screen. New files were created in the build process which were persisting and breaking the process. All of these have fixed here as well.
1 parent 409701f commit 104e2a4

File tree

5 files changed

+694
-249
lines changed

5 files changed

+694
-249
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ jobs:
138138
set +e
139139
rm -rf release/github
140140
rm -rf release/linux-unpacked
141+
rm release/builder-debug.yml
141142
- persist_to_workspace:
142143
root: ~/simplenote
143144
paths:
@@ -171,6 +172,7 @@ jobs:
171172
set +e
172173
rm -rf release/github
173174
rm -rf release/mac
175+
rm release/builder-debug.yml
174176
- persist_to_workspace:
175177
root: /Users/distiller/simplenote
176178
paths:
@@ -209,6 +211,10 @@ jobs:
209211
# package.json's `certificateSubjectName` to find the imported cert.
210212
Import-PfxCertificate -FilePath C:\Users\circleci\simplenote-electron\resources\certificates\win.p12 -CertStoreLocation Cert:\LocalMachine\Root -Password (ConvertTo-SecureString -String $env:WIN_CSC_KEY_PASSWORD -AsPlainText -Force)
211213
npx electron-builder --win -p onTag
214+
- run:
215+
name: Release cleanup
216+
command: |
217+
rm release/builder-debug.yml
212218
- persist_to_workspace:
213219
root: C:\Users\circleci\simplenote-electron
214220
paths:

desktop/app.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ module.exports = function main() {
3737
shouldQuit = true;
3838
});
3939

40+
// Fixes rendering bug on Linux when sandbox === true (Electron 11.0)
41+
if (process.platform === 'linux') {
42+
app.disableHardwareAcceleration();
43+
}
44+
4045
app.on('will-finish-launching', function () {
4146
setTimeout(updater.ping.bind(updater), config.updater.delay);
4247
app.on('open-url', function (event, url) {
@@ -96,7 +101,9 @@ module.exports = function main() {
96101
'test' !== process.env.NODE_ENV &&
97102
(isDev || process.argv.includes('--devtools'))
98103
) {
99-
mainWindow.openDevTools({ mode: 'detach' });
104+
mainWindow.openDevTools({
105+
mode: 'detach',
106+
});
100107
}
101108

102109
// Configure and set the application menu

lib/boot.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { parse } from 'cookie';
55
import getConfig from '../get-config';
66
import { boot as bootWithoutAuth } from './boot-without-auth';
77
import { boot as bootLoggingOut } from './logging-out';
8+
import { isElectron } from './utils/platform';
89

910
const config = getConfig();
1011

@@ -59,7 +60,13 @@ const clearStorage = (): Promise<void> =>
5960
.catch(() => resolveStorage());
6061
});
6162

62-
const forceReload = () => history.go();
63+
const forceReload = () => {
64+
if (isElectron) {
65+
window.electron?.send('reload');
66+
} else {
67+
window.history.go();
68+
}
69+
};
6370

6471
const loadAccount = () => {
6572
const storedUserData = localStorage.getItem('stored_user');

0 commit comments

Comments
 (0)