Skip to content

Commit

Permalink
make discussion fetch directly from server
Browse files Browse the repository at this point in the history
  • Loading branch information
andreymikhadyuk committed Dec 5, 2023
1 parent 61673d8 commit 73c5f7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/services/Discussion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DiscussionService {
try {
const snapshot = await this.getDiscussionCollection()
.doc(discussionId)
.get({ source });
.get({ source: "server" });
const fromCache = snapshot.metadata.fromCache ? "local cache" : "server";
const discussion = snapshot?.data() || null;

Expand All @@ -37,9 +37,9 @@ class DiscussionService {
discussionId,
snapshot?.data() || null,
);
if (!discussion && source === FirestoreDataSource.Cache) {
return this.getDiscussionById(discussionId, FirestoreDataSource.Server);
}
// if (!discussion && source === FirestoreDataSource.Cache) {
// return this.getDiscussionById(discussionId, FirestoreDataSource.Server);
// }

return discussion;
} catch (error) {
Expand Down

0 comments on commit 73c5f7a

Please sign in to comment.