Skip to content

Commit

Permalink
show error message when coll info is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
emma-sg committed Nov 2, 2023
1 parent d1b0ff6 commit 646a078
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions src/coll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import type {
SlMenu,
SlSelectEvent,
} from "@shoelace-style/shoelace";
import "@shoelace-style/shoelace/dist/components/dialog/dialog.js";
import "@shoelace-style/shoelace/dist/components/alert/alert.js";
import "@shoelace-style/shoelace/dist/components/button/button.js";
import "@shoelace-style/shoelace/dist/components/dialog/dialog.js";
import {
wrapCss,
rwpLogo,
Expand Down Expand Up @@ -782,17 +783,7 @@ class Coll extends LitElement {
width: 100%;
}
.info-bg {
background-color: whitesmoke;
width: 100%;
height: 100%;
display: flex;
overflow: auto;
}
.is-list {
margin: 1em;
background-color: whitesmoke;
height: fit-content;
}
Expand Down Expand Up @@ -1485,16 +1476,19 @@ class Coll extends LitElement {
}

renderCollInfo() {
if (!this.collInfo) return;
return html` <div class="info-bg">
<wr-coll-info
class="is-list"
.coll="${this.collInfo}"
?detailed="${true}"
?canDelete="${!this.embed}"
@coll-purge="${this.onPurgeCache}"
></wr-coll-info>
</div>`;
if (!this.collInfo)
return html`<sl-alert open variant="warning">
<sl-icon slot="icon" name="exclamation-triangle"></sl-icon>
<strong>Archive info is not available</strong><br />
Please reload and try again.
</sl-alert>`;
return html`<wr-coll-info
class="is-list"
.coll="${this.collInfo}"
?detailed="${true}"
?canDelete="${!this.embed}"
@coll-purge="${this.onPurgeCache}"
></wr-coll-info>`;
}

renderExtraToolbar(/*isDropdown = false*/) {
Expand Down

0 comments on commit 646a078

Please sign in to comment.