diff options
author | 2017-11-08 09:56:59 +0100 | |
---|---|---|
committer | 2017-11-08 09:56:59 +0100 | |
commit | 46d70c093c315386ea20b9c6e88af099508fb522 (patch) | |
tree | 9e1148d98476f864903900e819b509dfe12a7f14 /src/models/Service.js | |
parent | fix(App): Prevent app from redirecting when dropping link (diff) | |
parent | feature(Service): Add webview crash handler to display a user friendly message (diff) | |
download | ferdium-app-46d70c093c315386ea20b9c6e88af099508fb522.tar.gz ferdium-app-46d70c093c315386ea20b9c6e88af099508fb522.tar.zst ferdium-app-46d70c093c315386ea20b9c6e88af099508fb522.zip |
feat(Service): Add crash handler to display a user friendly message
(@dannyqiu)
Diffstat (limited to 'src/models/Service.js')
-rw-r--r-- | src/models/Service.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/models/Service.js b/src/models/Service.js index 484252e7c..dc53807f7 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -23,6 +23,7 @@ export default class Service { | |||
23 | @observable isNotificationEnabled = true; | 23 | @observable isNotificationEnabled = true; |
24 | @observable isIndirectMessageBadgeEnabled = true; | 24 | @observable isIndirectMessageBadgeEnabled = true; |
25 | @observable customIconUrl = ''; | 25 | @observable customIconUrl = ''; |
26 | @observable hasCrashed = false; | ||
26 | 27 | ||
27 | constructor(data, recipe) { | 28 | constructor(data, recipe) { |
28 | if (!data) { | 29 | if (!data) { |
@@ -117,6 +118,14 @@ export default class Service { | |||
117 | frameName, | 118 | frameName, |
118 | options, | 119 | options, |
119 | })); | 120 | })); |
121 | |||
122 | this.webview.addEventListener('did-start-loading', () => { | ||
123 | this.hasCrashed = false; | ||
124 | }); | ||
125 | |||
126 | this.webview.addEventListener('crashed', () => { | ||
127 | this.hasCrashed = true; | ||
128 | }); | ||
120 | } | 129 | } |
121 | 130 | ||
122 | initializeWebViewListener() { | 131 | initializeWebViewListener() { |