Update
This commit is contained in:
rodič
715f2a6379
revize
665576dbb8
|
@ -17,12 +17,34 @@
|
||||||
let uds = null;
|
let uds = null;
|
||||||
|
|
||||||
let int1 = null;
|
let int1 = null;
|
||||||
|
let apiLoadRetry = 0;
|
||||||
|
let apiOffline = false;
|
||||||
|
|
||||||
|
async function apiLoad() {
|
||||||
|
try {
|
||||||
|
await loadApiStatus();
|
||||||
|
await loadOrders($userData);
|
||||||
|
} catch (e) {
|
||||||
|
if (apiLoadRetry > 5) {
|
||||||
|
console.log("Too much retries, shutdown..");
|
||||||
|
apiOffline = true;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
console.log(`API cannot be accessed .. retrying [#${apiLoadRetry}] ..`);
|
||||||
|
apiLoadRetry = apiLoadRetry + 1;
|
||||||
|
setTimeout(() => apiLoad(), 250);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
apiLoadRetry = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
async function baseLoad() {
|
async function baseLoad() {
|
||||||
api.loadBundle($page.url.hostname === "localhost");
|
api.loadBundle($page.url.hostname === "localhost");
|
||||||
|
await apiLoad();
|
||||||
|
|
||||||
await loadApiStatus();
|
return true;
|
||||||
loadOrders($userData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
|
|
@ -137,6 +137,7 @@
|
||||||
function findEvent(bundle, eventId) {
|
function findEvent(bundle, eventId) {
|
||||||
const ev = bundle.spec.events.find((ev) => ev.id === eventId);
|
const ev = bundle.spec.events.find((ev) => ev.id === eventId);
|
||||||
if (!ev) {
|
if (!ev) {
|
||||||
|
console.log(`Event not found: ${eventId}`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
switch (ev.type) {
|
switch (ev.type) {
|
||||||
|
|
|
@ -182,6 +182,8 @@
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{claim.linkInfo.title}
|
{claim.linkInfo.title}
|
||||||
|
{#if !claim.linkInfo.title}{claim.link.type}:{claim.link
|
||||||
|
.id}{/if}
|
||||||
{#if claim.linkInfo.suffix} ({claim.linkInfo
|
{#if claim.linkInfo.suffix} ({claim.linkInfo
|
||||||
.suffix}){/if}
|
.suffix}){/if}
|
||||||
</a>
|
</a>
|
||||||
|
|
Načítá se…
Odkázat v novém úkolu