diff options
author | Vijay Aravamudhan <vraravam@users.noreply.github.com> | 2022-06-17 22:53:25 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-17 17:23:25 +0000 |
commit | 9b052c5345054a0f1cc879f795fd71e97a79c83e (patch) | |
tree | 264e84a790c9af9e576a1725274ea480bb7f4580 /src/models | |
parent | Revert "Feature: Progress Indicator for page loading (#248)" (diff) | |
download | ferdium-app-9b052c5345054a0f1cc879f795fd71e97a79c83e.tar.gz ferdium-app-9b052c5345054a0f1cc879f795fd71e97a79c83e.tar.zst ferdium-app-9b052c5345054a0f1cc879f795fd71e97a79c83e.zip |
Add a less-obstrusive progress bar on top of the Ferdium window (#285)
Diffstat (limited to 'src/models')
-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 | ||