fix: new destination can be created

This commit is contained in:
Andras Bacsai
2022-07-06 15:52:00 +02:00
committed by GitHub
parent 31d7e7e806
commit 64bb4a2525
7 changed files with 17 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ interface AppSession {
}
export const loginEmail: Writable<string | undefined> = writable()
export const appSession: Writable<AppSession> = writable({
version: '3.0.1',
version: '3.0.2',
userId: null,
teamId: null,
permission: 'read',

View File

@@ -136,6 +136,8 @@
statusInterval = setInterval(async () => {
await getStatus();
}, 2000);
} else {
$status.application.initialLoading = false;
}
});
</script>

View File

@@ -126,6 +126,8 @@
statusInterval = setInterval(async () => {
await getStatus();
}, 2000);
} else {
$status.database.initialLoading = false;
}
});
</script>

View File

@@ -34,12 +34,18 @@
return destination;
}
});
async function newDestination() {
const { id } = await post('/destinations/new', {});
return await goto(`/destinations/${id}`, { replaceState: true });
}
</script>
<div class="flex space-x-1 p-6 font-bold">
<div class="mr-4 text-2xl tracking-tight">{$t('index.destinations')}</div>
{#if $appSession.isAdmin}
<a href="/destinations/new" class="add-icon bg-sky-600 hover:bg-sky-500">
<button
on:click={newDestination}
class="add-icon bg-sky-600 hover:bg-sky-500">
<svg
class="w-6"
xmlns="http://www.w3.org/2000/svg"
@@ -53,7 +59,7 @@
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
/></svg
>
</a>
</button>
{/if}
</div>
<div class="flex-col justify-center">

View File

@@ -135,6 +135,8 @@
statusInterval = setInterval(async () => {
await getStatus();
}, 2000);
} else {
$status.service.initialLoading = false;
}
});
</script>