diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-04-05 23:58:48 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-05-16 00:55:00 +0200 |
commit | 111484690a5281e9ce0f2491a601a4b6562317f6 (patch) | |
tree | c33db7e86fe50eeb532a094d6ceace3aa3f4ba89 | |
parent | fix(renderer): Consistent store initialization (diff) | |
download | sophie-111484690a5281e9ce0f2491a601a4b6562317f6.tar.gz sophie-111484690a5281e9ce0f2491a601a4b6562317f6.tar.zst sophie-111484690a5281e9ce0f2491a601a4b6562317f6.zip |
fix(main): Do not show spurious abort error
When the user aborts loading the webpage there is no error, so we don't
need to display any and can just wait for the loading finished event
from chromium.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
-rw-r--r-- | packages/main/src/infrastructure/electron/impl/ElectronServiceView.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/main/src/infrastructure/electron/impl/ElectronServiceView.ts b/packages/main/src/infrastructure/electron/impl/ElectronServiceView.ts index 5062da0..340c523 100644 --- a/packages/main/src/infrastructure/electron/impl/ElectronServiceView.ts +++ b/packages/main/src/infrastructure/electron/impl/ElectronServiceView.ts | |||
@@ -78,6 +78,13 @@ export default class ElectronServiceView implements ServiceView { | |||
78 | webContents.on( | 78 | webContents.on( |
79 | 'did-fail-load', | 79 | 'did-fail-load', |
80 | (_event, errorCode, errorDesc, url, isMainFrame) => { | 80 | (_event, errorCode, errorDesc, url, isMainFrame) => { |
81 | if (errorCode === -3) { | ||
82 | // Do not signal error on ABORTED, since that corresponds to an action requested by the user. | ||
83 | // Other events (`did-start-loading` or `did-stop-loading`) will cause service state changes | ||
84 | // that are appropriate for the user action. | ||
85 | log.debug('Loading', url, 'in service', this.id, 'aborted by user'); | ||
86 | return; | ||
87 | } | ||
81 | if (isMainFrame) { | 88 | if (isMainFrame) { |
82 | setLocation(url); | 89 | setLocation(url); |
83 | service.setFailed(errorCode, errorDesc); | 90 | service.setFailed(errorCode, errorDesc); |