tangled
alpha
login
or
join now
witchcraft.systems
/
pds-dash
15
fork
atom
this repo has no description
15
fork
atom
overview
issues
pulls
pipelines
Fix typescript and svelte warnings
ari.express
10 months ago
9a2ea504
bba23092
verified
This commit was signed with the committer's
known signature
.
ari.express
SSH Key Fingerprint:
SHA256:j4xpQafvRcIH4rwZqM5aREIogWsCjyYohia7vH0+uZY=
+3
-12
3 changed files
expand all
collapse all
unified
split
src
App.svelte
lib
PostComponent.svelte
pdsfetch.ts
+1
-5
src/App.svelte
···
16
16
});
17
17
});
18
18
// Infinite loading function
19
19
-
const onInfinite = ({ detail: { loaded, complete } }) => {
19
19
+
const onInfinite = ({ detail: { loaded, complete } } : { detail : { loaded : () => void, complete : () => void}}) => {
20
20
getNextPosts().then((newPosts) => {
21
21
if (newPosts.length > 0) {
22
22
posts = [...posts, ...newPosts];
···
53
53
<PostComponent post={postObject as Post} />
54
54
{/each}
55
55
<InfiniteLoading on:infinite={onInfinite}
56
56
-
id="infiniteLoading"
57
56
distance={0}
58
58
-
threshold={0}
59
59
-
useWindow={false}
60
60
-
forceUseWindow={false}
61
57
/>
62
58
<div id="spacer"></div>
63
59
</div>
+2
-2
src/lib/PostComponent.svelte
···
113
113
<div id="carouselControls">
114
114
<button
115
115
id="prevBtn"
116
116
-
on:click={prevImage}
116
116
+
onclick={prevImage}
117
117
disabled={currentImageIndex === 0}>←</button
118
118
>
119
119
<div id="carouselIndicators">
···
125
125
</div>
126
126
<button
127
127
id="nextBtn"
128
128
-
on:click={nextImage}
128
128
+
onclick={nextImage}
129
129
disabled={currentImageIndex === post.imagesCid.length - 1}
130
130
>→</button
131
131
>
-5
src/lib/pdsfetch.ts
···
215
215
}
216
216
});
217
217
if (cutoffDate) {
218
218
-
console.log("Cutoff date:", cutoffDate);
219
218
return cutoffDate;
220
219
} else {
221
220
return new Date(now);
···
303
302
return postDate <= now;
304
303
});
305
304
}
306
306
-
// append the new posts to the existing posts
307
305
308
306
const newPosts = records.map((record) => {
309
307
const account = accountsMetadata.find(
···
316
314
}
317
315
return new Post(record, account);
318
316
});
319
319
-
console.log("Fetched posts:", newPosts);
320
320
-
console.log("Metadata:", accountsMetadata);
321
317
return newPosts;
322
318
};
323
319
324
320
const fetchPostsForUser = async (did: At.Did, cursor: string | null) => {
325
321
try {
326
326
-
console.log("Fetching posts for user:", did, "with Cursor: ", cursor);
327
322
const { data } = await rpc.get("com.atproto.repo.listRecords", {
328
323
params: {
329
324
repo: did as At.Identifier,