Skip to content

Commit

Permalink
revert "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 73c5f7a commit abea513
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: "server" });
.get({ source });
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 abea513

Please sign in to comment.