diff --git a/src/js/dataLayer/dataStore.js b/src/js/dataLayer/dataStore.js index 4c5884e0..0eaefe45 100644 --- a/src/js/dataLayer/dataStore.js +++ b/src/js/dataLayer/dataStore.js @@ -88,6 +88,7 @@ export class DataStore extends ReactiveStore { const normalizedQuotedPost = embedViewRecordToPostView(quotedPost); this.mergeProfile(normalizedQuotedPost.author); + this._saveStatusForProfile(normalizedQuotedPost.author); if (!this.$posts.has(quotedPost.uri)) { this.$embeddedPosts.set(quotedPost.uri, normalizedQuotedPost); } @@ -96,6 +97,7 @@ export class DataStore extends ReactiveStore { for (const post of posts) { this.mergeProfile(post.author); + this._saveStatusForProfile(post.author); this.$posts.set(post.uri, post); // Delete matching embedded post, since they're only used as previews this.$embeddedPosts.delete(post.uri); diff --git a/tests/unit/specs/dataLayer/liveStatus.test.js b/tests/unit/specs/dataLayer/liveStatus.test.js index b79299fc..5154b222 100644 --- a/tests/unit/specs/dataLayer/liveStatus.test.js +++ b/tests/unit/specs/dataLayer/liveStatus.test.js @@ -229,15 +229,14 @@ describe("live status", () => { it("attaches isLive to hydrated profiles and post authors", () => { const { derived, dataStore } = makeDerived(); - addLiveProfile( - dataStore, - createLiveStatusView({ did, expiresAt: futureExpiry() }), - ); + const status = createLiveStatusView({ did, expiresAt: futureExpiry() }); + addLiveProfile(dataStore, status); const post = createPost({ uri: `at://${did}/app.bsky.feed.post/live1`, text: "hello", authorHandle: "liveuser.bsky.social", authorDisplayName: "Live User", + authorStatus: status, }); dataStore.setPosts([post]); assert.equal(derived.$hydratedProfiles.get(did).isLive, true);