Fix typescript and svelte warnings
This commit is contained in:
parent
bba230920b
commit
9a2ea50420
3 changed files with 3 additions and 12 deletions
|
@ -16,7 +16,7 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// Infinite loading function
|
// Infinite loading function
|
||||||
const onInfinite = ({ detail: { loaded, complete } }) => {
|
const onInfinite = ({ detail: { loaded, complete } } : { detail : { loaded : () => void, complete : () => void}}) => {
|
||||||
getNextPosts().then((newPosts) => {
|
getNextPosts().then((newPosts) => {
|
||||||
if (newPosts.length > 0) {
|
if (newPosts.length > 0) {
|
||||||
posts = [...posts, ...newPosts];
|
posts = [...posts, ...newPosts];
|
||||||
|
@ -53,11 +53,7 @@
|
||||||
<PostComponent post={postObject as Post} />
|
<PostComponent post={postObject as Post} />
|
||||||
{/each}
|
{/each}
|
||||||
<InfiniteLoading on:infinite={onInfinite}
|
<InfiniteLoading on:infinite={onInfinite}
|
||||||
id="infiniteLoading"
|
|
||||||
distance={0}
|
distance={0}
|
||||||
threshold={0}
|
|
||||||
useWindow={false}
|
|
||||||
forceUseWindow={false}
|
|
||||||
/>
|
/>
|
||||||
<div id="spacer"></div>
|
<div id="spacer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
<div id="carouselControls">
|
<div id="carouselControls">
|
||||||
<button
|
<button
|
||||||
id="prevBtn"
|
id="prevBtn"
|
||||||
on:click={prevImage}
|
onclick={prevImage}
|
||||||
disabled={currentImageIndex === 0}>←</button
|
disabled={currentImageIndex === 0}>←</button
|
||||||
>
|
>
|
||||||
<div id="carouselIndicators">
|
<div id="carouselIndicators">
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
id="nextBtn"
|
id="nextBtn"
|
||||||
on:click={nextImage}
|
onclick={nextImage}
|
||||||
disabled={currentImageIndex === post.imagesCid.length - 1}
|
disabled={currentImageIndex === post.imagesCid.length - 1}
|
||||||
>→</button
|
>→</button
|
||||||
>
|
>
|
||||||
|
|
|
@ -215,7 +215,6 @@ const getCutoffDate = (postAccounts: PostsAcc[]) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (cutoffDate) {
|
if (cutoffDate) {
|
||||||
console.log("Cutoff date:", cutoffDate);
|
|
||||||
return cutoffDate;
|
return cutoffDate;
|
||||||
} else {
|
} else {
|
||||||
return new Date(now);
|
return new Date(now);
|
||||||
|
@ -303,7 +302,6 @@ const getNextPosts = async () => {
|
||||||
return postDate <= now;
|
return postDate <= now;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// append the new posts to the existing posts
|
|
||||||
|
|
||||||
const newPosts = records.map((record) => {
|
const newPosts = records.map((record) => {
|
||||||
const account = accountsMetadata.find(
|
const account = accountsMetadata.find(
|
||||||
|
@ -316,14 +314,11 @@ const getNextPosts = async () => {
|
||||||
}
|
}
|
||||||
return new Post(record, account);
|
return new Post(record, account);
|
||||||
});
|
});
|
||||||
console.log("Fetched posts:", newPosts);
|
|
||||||
console.log("Metadata:", accountsMetadata);
|
|
||||||
return newPosts;
|
return newPosts;
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchPostsForUser = async (did: At.Did, cursor: string | null) => {
|
const fetchPostsForUser = async (did: At.Did, cursor: string | null) => {
|
||||||
try {
|
try {
|
||||||
console.log("Fetching posts for user:", did, "with Cursor: ", cursor);
|
|
||||||
const { data } = await rpc.get("com.atproto.repo.listRecords", {
|
const { data } = await rpc.get("com.atproto.repo.listRecords", {
|
||||||
params: {
|
params: {
|
||||||
repo: did as At.Identifier,
|
repo: did as At.Identifier,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue