feat: refresh button next to error in lists

This commit is contained in:
Fulmine 2022-03-01 12:29:21 +01:00
parent 50e7e9e200
commit 929987e995
2 changed files with 18 additions and 2 deletions

View File

@ -45,6 +45,7 @@
async function fetchGroups() { async function fetchGroups() {
err = "";
listLoading = true; listLoading = true;
try { try {
const res: Group[] = await api().systems(isPublic ? id : "@me").groups.get({ auth: !isPublic, query: { with_members: !isPublic } }); const res: Group[] = await api().systems(isPublic ? id : "@me").groups.get({ auth: !isPublic, query: { with_members: !isPublic } });
@ -258,7 +259,14 @@
<Spinner class="d-inline-block" /> <Spinner class="d-inline-block" />
</div> </div>
{:else if err} {:else if err}
<Row>
<Col xs={12} lg={10}>
<Alert color="danger">{err}</Alert> <Alert color="danger">{err}</Alert>
</Col>
<Col xs={12} lg={2}>
<Button class="w-100 mb-3" color="primary" on:click={fetchGroups}>Refresh</Button>
</Col>
</Row>
{:else} {:else}
<Row> <Row>

View File

@ -44,6 +44,7 @@
}); });
async function fetchMembers() { async function fetchMembers() {
err = "";
listLoading = true; listLoading = true;
try { try {
const res: Member[] = await api().systems(isPublic ? id : "@me").members.get({ auth: !isPublic }); const res: Member[] = await api().systems(isPublic ? id : "@me").members.get({ auth: !isPublic });
@ -260,7 +261,14 @@
<Spinner class="d-inline-block" /> <Spinner class="d-inline-block" />
</div> </div>
{:else if err} {:else if err}
<Row>
<Col xs={12} lg={10}>
<Alert color="danger">{err}</Alert> <Alert color="danger">{err}</Alert>
</Col>
<Col xs={12} lg={2}>
<Button class="w-100 mb-3" color="primary" on:click={fetchMembers}>Refresh</Button>
</Col>
</Row>
{:else} {:else}
<Row> <Row>