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() {
err = "";
listLoading = true;
try {
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" />
</div>
{:else if err}
<Row>
<Col xs={12} lg={10}>
<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}
<Row>

View File

@ -44,6 +44,7 @@
});
async function fetchMembers() {
err = "";
listLoading = true;
try {
const res: Member[] = await api().systems(isPublic ? id : "@me").members.get({ auth: !isPublic });
@ -260,7 +261,14 @@
<Spinner class="d-inline-block" />
</div>
{:else if err}
<Row>
<Col xs={12} lg={10}>
<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}
<Row>