Skip to content

Commit

Permalink
[web] Update threadActivityStore[activeThread].lastNavigatedTo state
Browse files Browse the repository at this point in the history
Summary:
While the motivations for introducing `threadActivityStore` were about improving performance on `native`, we're making parallel changes to `web` for consistency.

---

Depends on D9402

Test Plan:
Navigated to various threads and checked `threadActivityStore` updated as expected (this is safe to land, will introduce migrations that clean things up when ripping out `lastNavigatedTo` and `lastPruned` from `messageStore.threads`):

{F795614}

{F795615}

Reviewers: ashoat, tomek, ginsu

Reviewed By: ashoat

Subscribers: wyilio

Differential Revision: https://phab.comm.dev/D9404
  • Loading branch information
atulsmadhugiri committed Oct 9, 2023
1 parent 7c3352f commit 8a192aa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions web/redux/redux-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function validateState(oldState: AppState, state: AppState): AppState {
oldActiveThread !== activeThread &&
state.messageStore.threads[activeThread]
) {
// Update messageStore.threads[activeThread].lastNavigatedTo
const now = Date.now();
state = {
...state,
messageStore: {
Expand All @@ -337,10 +337,17 @@ function validateState(oldState: AppState, state: AppState): AppState {
...state.messageStore.threads,
[activeThread]: {
...state.messageStore.threads[activeThread],
lastNavigatedTo: Date.now(),
lastNavigatedTo: now,
},
},
},
threadActivityStore: {
...state.threadActivityStore,
[activeThread]: {
...state.threadActivityStore[activeThread],
lastNavigatedTo: now,
},
},
};
}

Expand Down

0 comments on commit 8a192aa

Please sign in to comment.