diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2021-10-07 14:07:13 +0530 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2021-10-07 14:07:13 +0530 |
commit | 42e31e875e4a4ea17753be1a084745d86ca29a89 (patch) | |
tree | 373ec6d2799b0a60471fd89d3fb6290b3696a3f8 | |
parent | New Crowdin updates (#2034) (diff) | |
download | ferdium-app-42e31e875e4a4ea17753be1a084745d86ca29a89.tar.gz ferdium-app-42e31e875e4a4ea17753be1a084745d86ca29a89.tar.zst ferdium-app-42e31e875e4a4ea17753be1a084745d86ca29a89.zip |
fix: defensive programming to avoid js error
-rw-r--r-- | src/stores/ServicesStore.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index ce6675866..e27567e8f 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -888,6 +888,7 @@ export default class ServicesStore extends Store { | |||
888 | return this.actions.todos.reload(); | 888 | return this.actions.todos.reload(); |
889 | } | 889 | } |
890 | 890 | ||
891 | if (!service.webview) return; | ||
891 | return service.webview.loadURL(service.url); | 892 | return service.webview.loadURL(service.url); |
892 | } | 893 | } |
893 | 894 | ||
@@ -995,7 +996,7 @@ export default class ServicesStore extends Store { | |||
995 | const service = this.one(serviceId); | 996 | const service = this.one(serviceId); |
996 | if (service.isTodosService) { | 997 | if (service.isTodosService) { |
997 | this.actions.todos.openDevTools(); | 998 | this.actions.todos.openDevTools(); |
998 | } else { | 999 | } else if (service.webview) { |
999 | service.webview.openDevTools(); | 1000 | service.webview.openDevTools(); |
1000 | } | 1001 | } |
1001 | } | 1002 | } |
@@ -1147,7 +1148,7 @@ export default class ServicesStore extends Store { | |||
1147 | const { isAttached } = service; | 1148 | const { isAttached } = service; |
1148 | const isMuted = isAppMuted || service.isMuted; | 1149 | const isMuted = isAppMuted || service.isMuted; |
1149 | 1150 | ||
1150 | if (isAttached) { | 1151 | if (isAttached && service.webview) { |
1151 | service.webview.audioMuted = isMuted; | 1152 | service.webview.audioMuted = isMuted; |
1152 | } | 1153 | } |
1153 | } | 1154 | } |