fix profile pinned posts duplication

we really need a better system for aborting requests via state
changes; for non-pinned posts and notifications, it's possible to screw
up state by navigating in a particular way, causing fetched feeds to loop for
seemingly no reason.
This commit is contained in:
ari melody 2025-07-14 04:22:23 +01:00
parent 22d6c5b90a
commit a5a066be3d
Signed by: ari
GPG key ID: CF99829C92678188

View file

@ -89,13 +89,11 @@
token,
profile.id,
).then(async posts => {
const parsed_posts = [];
for (let post of posts) {
const parsedPost = await parsePost(post, 1);
profile_pinned_posts.update(posts => {
posts.push(parsedPost);
return posts;
});
parsed_posts.push(await parsePost(post, 1));
}
profile_pinned_posts.set(parsed_posts);
});
let post_lock = false; // `true` == "locked"