mirror of
https://github.com/danbulant/design
synced 2026-05-19 04:08:46 +00:00
fix eager post load
This commit is contained in:
parent
ccdf7df313
commit
fc059a688a
1 changed files with 7 additions and 7 deletions
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
console.error($page.error);
|
||||
|
||||
function loadPosts() {
|
||||
let posts = fetch("/api/posts.json").then(t => t.json()).catch(t => []);
|
||||
return posts;
|
||||
}
|
||||
// function loadPosts() {
|
||||
// let posts = fetch("/api/posts.json").then(t => t.json()).catch(t => []);
|
||||
// return posts;
|
||||
// }
|
||||
</script>
|
||||
|
||||
<h1 class="text-center">
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
<Button href="/">Go to my home page</Button>
|
||||
</div>
|
||||
|
||||
{#await loadPosts() then posts}
|
||||
<!-- {#await loadPosts() then posts}
|
||||
{#if posts && posts.length > 0}
|
||||
<div class="my-4 separator text-big">OR</div>
|
||||
|
||||
|
|
@ -51,8 +51,8 @@
|
|||
</main>
|
||||
{/if}
|
||||
{:catch error}
|
||||
<!-- Couldn't load -->
|
||||
{/await}
|
||||
<!-- Couldn't load ->
|
||||
{/await} -->
|
||||
|
||||
<style>
|
||||
.flex {
|
||||
|
|
|
|||
Loading…
Reference in a new issue