Skip to content

Commit

Permalink
CW-2054 Fixed infinity loading for guest user
Browse files Browse the repository at this point in the history
  • Loading branch information
MeyerPV committed Sep 12, 2023
1 parent 8fb2ce0 commit 0ce5248
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/services/CommonFeedObjectUserUnique.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ class CommonFeedObjectUserUniqueService {
feedObjectId: string,
callback: (data: CommonFeedObjectUserUnique) => void,
): UnsubscribeFunction => {
const query = this.getCommonFeedObjectUserUniqueSubCollection(commonId)
.where("feedObjectId", "==", feedObjectId)
.where("userId", "==", userId);
let query = this.getCommonFeedObjectUserUniqueSubCollection(commonId).where(
"feedObjectId",
"==",
feedObjectId,
);

if (userId) {
query = query.where("userId", "==", userId);
}

return query.onSnapshot((snapshot) => {
const data = snapshot.docChanges()[0]?.doc.data();
Expand Down

0 comments on commit 0ce5248

Please sign in to comment.