diff options
author | 2018-12-08 22:33:07 +0100 | |
---|---|---|
committer | 2018-12-08 22:33:07 +0100 | |
commit | 8d81522d2ddc7652321c583862d495396d44bb8e (patch) | |
tree | ef73573b6b68e28e3568355e036f26df434f605c | |
parent | Revamp app loaders (diff) | |
download | ferdium-app-8d81522d2ddc7652321c583862d495396d44bb8e.tar.gz ferdium-app-8d81522d2ddc7652321c583862d495396d44bb8e.tar.zst ferdium-app-8d81522d2ddc7652321c583862d495396d44bb8e.zip |
Only show loader on initial service load
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 2 | ||||
-rw-r--r-- | src/models/Service.js | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index b3def3fa5..3ec0c3a67 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -89,7 +89,7 @@ export default @observer class ServiceWebview extends Component { | |||
89 | reload={reload} | 89 | reload={reload} |
90 | /> | 90 | /> |
91 | )} | 91 | )} |
92 | {service.isLoading && ( | 92 | {service.isLoading && service.isFirstLoad && ( |
93 | <WebviewLoader | 93 | <WebviewLoader |
94 | loaded={!service.isLoading} | 94 | loaded={!service.isLoading} |
95 | name={service.name} | 95 | name={service.name} |
diff --git a/src/models/Service.js b/src/models/Service.js index 7ba9aa396..fd867b8a8 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -33,7 +33,7 @@ export default class Service { | |||
33 | @observable isDarkModeEnabled = false; | 33 | @observable isDarkModeEnabled = false; |
34 | @observable spellcheckerLanguage = null; | 34 | @observable spellcheckerLanguage = null; |
35 | 35 | ||
36 | // @observable isFirstNavigation = true; | 36 | @observable isFirstLoad = true; |
37 | @observable isLoading = true; | 37 | @observable isLoading = true; |
38 | @observable isError = false; | 38 | @observable isError = false; |
39 | @observable errorMessage = ''; | 39 | @observable errorMessage = ''; |
@@ -163,6 +163,7 @@ export default class Service { | |||
163 | 163 | ||
164 | this.webview.addEventListener('did-stop-loading', () => { | 164 | this.webview.addEventListener('did-stop-loading', () => { |
165 | this.isLoading = false; | 165 | this.isLoading = false; |
166 | this.isFirstLoad = false; | ||
166 | }); | 167 | }); |
167 | 168 | ||
168 | this.webview.addEventListener('did-fail-load', (event) => { | 169 | this.webview.addEventListener('did-fail-load', (event) => { |