Skip to content

Commit

Permalink
Add missing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
larkox committed Dec 11, 2024
1 parent 72c4132 commit 1e4fcb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ export const transformThreadRecord = ({action, database, value}: TransformerArgs
const fieldsMapper = (thread: ThreadModel) => {
thread._raw.id = isCreateAction ? (raw?.id ?? thread.id) : record.id;

// When post is individually fetched, we get last_reply_at as 0, so we use the record's value
thread.lastReplyAt = raw.last_reply_at || record?.lastReplyAt;
// When post is individually fetched, we get last_reply_at as 0, so we use the record's value.
// If there is no reply at, we default to the post's create_at
thread.lastReplyAt = raw.last_reply_at || record?.lastReplyAt || raw.post.create_at;

thread.lastViewedAt = raw.last_viewed_at ?? record?.lastViewedAt ?? 0;
thread.replyCount = raw.reply_count;
Expand Down
2 changes: 1 addition & 1 deletion app/screens/global_threads/threads_list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const enhanced = withObservables(['tab', 'teamId'], ({database, tab, teamId}: Pr
threads: teamThreadsSyncObserver.pipe(
switchMap((teamThreadsSync) => {
const earliest = tab === 'all' ? teamThreadsSync?.[0]?.earliest : 0;
return queryThreadsInTeam(database, teamId, getOnlyUnreads, false, true, true, earliest).observe();
return queryThreadsInTeam(database, teamId, getOnlyUnreads, true, true, true, earliest).observe();
}),
),
};
Expand Down

0 comments on commit 1e4fcb3

Please sign in to comment.