Skip to content

Commit

Permalink
Merge pull request #5 from flo-bit/main
Browse files Browse the repository at this point in the history
fix users not showing
  • Loading branch information
flo-bit authored Nov 19, 2024
2 parents aa00276 + 1436748 commit 4ae6787
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/routes/particles/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ import ParticleSystem from './particles';
});
const url =
'wss://jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.bsky.feed.post&wantedCollections=app.bsky.feed.like&wantedCollections=app.bsky.graph.follow';
'wss://jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.bsky.feed.post&wantedCollections=app.bsky.feed.like&wantedCollections=app.bsky.graph.follow&wantedCollections=app.bsky.actor.profile';
// WebSocket logic
const ws = new WebSocket(url);
Expand All @@ -149,24 +149,26 @@ import ParticleSystem from './particles';
ws.onmessage = (event) => {
const json = JSON.parse(event.data);
if (json.kind === 'account') console.log(json);
if (json.kind === 'commit') {
if (json.commit.collection === 'app.bsky.feed.post' && json.commit.operation === 'create') {
spawnParticle('post');
} else if (
json.commit.collection === 'app.bsky.feed.like' &&
json.commit.operation === 'create'
) {
spawnParticle('heart');
} else if (
json.commit.collection === 'app.bsky.graph.follow' &&
json.commit.operation === 'create'
) {
spawnParticle('follow');
}
} else if (json.kind === 'account' && json.account.active) {
spawnParticle('user');
if (json.kind !== 'commit') return;
if (json.commit.collection === 'app.bsky.feed.post' && json.commit.operation === 'create') {
spawnParticle('post');
} else if (
json.commit.collection === 'app.bsky.feed.like' &&
json.commit.operation === 'create'
) {
spawnParticle('heart');
} else if (
json.commit.collection === 'app.bsky.graph.follow' &&
json.commit.operation === 'create'
) {
spawnParticle('follow');
} else if (
json.commit.collection === 'app.bsky.actor.profile' &&
json.commit.operation === 'create'
) {
spawnParticle('user')
}
};
Expand Down

0 comments on commit 4ae6787

Please sign in to comment.