diff options
author | 2022-06-14 10:01:50 +0100 | |
---|---|---|
committer | 2022-06-14 09:01:50 +0000 | |
commit | 87bf6224518fd39ba7485cde691bad5941216258 (patch) | |
tree | da7f6cc57c99486b772c54965244bfdac3b76231 /src/models/Service.js | |
parent | 6.0.0-nightly.60 [skip ci] (diff) | |
download | ferdium-app-87bf6224518fd39ba7485cde691bad5941216258.tar.gz ferdium-app-87bf6224518fd39ba7485cde691bad5941216258.tar.zst ferdium-app-87bf6224518fd39ba7485cde691bad5941216258.zip |
Feature: Progress Indicator for page loading (#248)
Fix one of the asks in #239
Diffstat (limited to 'src/models/Service.js')
-rw-r--r-- | src/models/Service.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/models/Service.js b/src/models/Service.js index e2b9ae7c6..ae13a063d 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -74,6 +74,8 @@ export default class Service { | |||
74 | 74 | ||
75 | @observable isLoading = true; | 75 | @observable isLoading = true; |
76 | 76 | ||
77 | @observable isLoadingPage = true; | ||
78 | |||
77 | @observable isError = false; | 79 | @observable isError = false; |
78 | 80 | ||
79 | @observable errorMessage = ''; | 81 | @observable errorMessage = ''; |
@@ -383,11 +385,20 @@ export default class Service { | |||
383 | 385 | ||
384 | this.hasCrashed = false; | 386 | this.hasCrashed = false; |
385 | this.isLoading = true; | 387 | this.isLoading = true; |
388 | this.isLoadingPage = true; | ||
386 | this.isError = false; | 389 | this.isError = false; |
387 | }); | 390 | }); |
388 | 391 | ||
392 | this.webview.addEventListener('did-stop-loading', event => { | ||
393 | debug('Did stop load', this.name, event); | ||
394 | |||
395 | this.isLoading = false; | ||
396 | this.isLoadingPage = false; | ||
397 | }); | ||
398 | |||
389 | const didLoad = () => { | 399 | const didLoad = () => { |
390 | this.isLoading = false; | 400 | this.isLoading = false; |
401 | this.isLoadingPage = false; | ||
391 | 402 | ||
392 | if (!this.isError) { | 403 | if (!this.isError) { |
393 | this.isFirstLoad = false; | 404 | this.isFirstLoad = false; |
@@ -407,6 +418,7 @@ export default class Service { | |||
407 | this.isError = true; | 418 | this.isError = true; |
408 | this.errorMessage = event.errorDescription; | 419 | this.errorMessage = event.errorDescription; |
409 | this.isLoading = false; | 420 | this.isLoading = false; |
421 | this.isLoadingPage = false; | ||
410 | } | 422 | } |
411 | }); | 423 | }); |
412 | 424 | ||