Skip to content

Commit

Permalink
Use a less intrusive way to show themes are loading
Browse files Browse the repository at this point in the history
  • Loading branch information
adube committed Mar 10, 2020
1 parent 6d404d5 commit d1f9864
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions contribs/gmf/apps/desktop/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@
<gmf-authentication
gmf-authentication-info-message="mainCtrl.loginInfoMessage"
></gmf-authentication>
<div ng-if="mainCtrl.postLoading">
<i class="fa custom-spinner-connect fa-spin">
<%=require('gmf/icons/spinner.svg?viewbox&height=1em')%>
</i>
{{'Loading themes, please wait...' | translate}}
</div>
</div>
</div>
<div ng-show="mainCtrl.printPanelActive" class="row">
Expand Down
6 changes: 6 additions & 0 deletions contribs/gmf/apps/desktop_alt/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@
<gmf-authentication
gmf-authentication-info-message="mainCtrl.loginInfoMessage">
</gmf-authentication>
<div ng-if="mainCtrl.postLoading">
<i class="fa custom-spinner-connect fa-spin">
<%=require('gmf/icons/spinner.svg?viewbox&height=1em')%>
</i>
{{'Loading themes, please wait...' | translate}}
</div>
</div>
</div>
<div ng-show="mainCtrl.printPanelActive" class="row">
Expand Down
7 changes: 7 additions & 0 deletions contribs/gmf/src/controllers/AbstractAppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ export function AbstractAppController(config, map, $scope, $injector) {
this.loading = false;
});

/**
* This property is set to `true` when the themes change after a
* successful login
* @type {boolean}
*/
this.postLoading = false;

/**
* Permalink service
* @type {import("gmf/permalink/Permalink.js").PermalinkService}
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/controllers/AbstractDesktopController.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ export class AbstractDesktopController extends AbstractAPIController {
// have finished loading.
$scope.$watch(() => this.gmfUser.username, (newVal) => {
if (newVal !== null && this.loginActive) {
this.loading = true;
this.postLoading = true;
this.gmfThemes.getThemesObject().finally(() => {
this.loading = false;
this.postLoading = false;
this.loginActive = false;
});
}
Expand Down

0 comments on commit d1f9864

Please sign in to comment.