mirror of
https://git.witchcraft.systems/scientific-witchery/pds-dash.git
synced 2025-06-08 07:54:05 +10:00
At a glance, the fetch mechanism works
This commit is contained in:
parent
26aff55dc2
commit
6ca0a971f6
3 changed files with 187 additions and 45 deletions
|
@ -1,9 +1,9 @@
|
|||
<script lang="ts">
|
||||
import PostComponent from "./lib/PostComponent.svelte";
|
||||
import AccountComponent from "./lib/AccountComponent.svelte";
|
||||
import { fetchAllPosts, Post, getAllMetadataFromPds } from "./lib/pdsfetch";
|
||||
import { getNextPosts, Post, getAllMetadataFromPds } from "./lib/pdsfetch";
|
||||
import { Config } from "../config";
|
||||
const postsPromise = fetchAllPosts();
|
||||
const postsPromise = getNextPosts();
|
||||
const accountsPromise = getAllMetadataFromPds();
|
||||
</script>
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
|||
{#await accountsPromise}
|
||||
<p>Loading...</p>
|
||||
{:then accountsData}
|
||||
|
||||
<div id="Account">
|
||||
<h1 id="Header">ATProto PDS</h1>
|
||||
<p>Home to {accountsData.length} accounts</p>
|
||||
|
@ -29,6 +30,9 @@
|
|||
{#await postsPromise}
|
||||
<p>Loading...</p>
|
||||
{:then postsData}
|
||||
<button on:click={getNextPosts}>
|
||||
Load more posts
|
||||
</button>
|
||||
<div id="Feed">
|
||||
<div id="spacer"></div>
|
||||
{#each postsData as postObject}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue