Maybe fix bad rendering with empty logs?
This commit is contained in:
parent
caa87af34c
commit
aec4f3e7d5
|
@ -5,7 +5,7 @@
|
|||
const { id } = $page.params;
|
||||
|
||||
let server;
|
||||
let invites;
|
||||
let invites = [];
|
||||
let loaded = false;
|
||||
|
||||
onMount(async () => {
|
||||
|
@ -21,14 +21,14 @@
|
|||
if (r2.ok) {
|
||||
invites = await r2.json();
|
||||
for (let invite in invites) {
|
||||
const logsReq = await fetch(`/api/v1/invite/${invites[invite].token}/log`)
|
||||
invites[invite]["log"] = []
|
||||
const logsReq = await fetch(`/api/v1/invite/${invites[invite].token}/log`)
|
||||
if (logsReq.ok) {
|
||||
invites[invite]["log"] = await logsReq.json()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('not ok');
|
||||
console.log('no invites');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
loaded = true;
|
||||
servers = await request.json();
|
||||
} else {
|
||||
console.log('not ok');
|
||||
loaded = true;
|
||||
console.log('no servers');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue