Explicitly show the loading process

This commit is contained in:
Yuri Sizov
2021-09-06 00:41:50 +03:00
parent 6cf7457c2a
commit 142b88403c

View File

@@ -34,6 +34,7 @@ export default class EntryComponent extends LitElement {
super();
this._entryRequested = false;
this._isLoading = true;
this._generatedAt = null;
this._teams = {};
@@ -59,6 +60,7 @@ export default class EntryComponent extends LitElement {
return;
}
this._entryRequested = true;
this._isLoading = true;
const data = await greports.api.getData();
if (data) {
@@ -140,6 +142,7 @@ export default class EntryComponent extends LitElement {
this._pulls = [];
}
this._isLoading = false;
this.requestUpdate();
}
@@ -167,6 +170,9 @@ export default class EntryComponent extends LitElement {
<gr-index-entry .generated_at="${this._generatedAt}"></gr-index-entry>
<gr-index-description></gr-index-description>
${(this._isLoading ? html`
<h3>Loading...</h3>
` : html`
<div class="teams">
<gr-team-list
.teams="${this._orderedTeams}"
@@ -184,6 +190,7 @@ export default class EntryComponent extends LitElement {
.authors="${this._authors}"
></gr-pull-list>
</div>
`)}
</page-content>
`;
}