Page MenuHomePhabricator

D11622.id38991.diff
No OneTemporary

D11622.id38991.diff

diff --git a/lib/reducers/thread-activity-reducer.test.js b/lib/reducers/thread-activity-reducer.test.js
--- a/lib/reducers/thread-activity-reducer.test.js
+++ b/lib/reducers/thread-activity-reducer.test.js
@@ -39,6 +39,24 @@
expect(result).toEqual(expectedState);
});
+ test('should create new thread activity entry with only lastNavigatedTo field', () => {
+ const initialState = {};
+ const action = {
+ type: updateThreadLastNavigatedActionType,
+ payload: {
+ threadID: 'thread1',
+ time: 1639522317443,
+ },
+ };
+ const expectedState = {
+ thread1: {
+ lastNavigatedTo: 1639522317443,
+ },
+ };
+ const result = reduceThreadActivity(initialState, action);
+ expect(result).toEqual(expectedState);
+ });
+
test('returns the initial state if the action type is not recognized', () => {
const initialState = {
thread1: {
diff --git a/lib/types/thread-activity-types.js b/lib/types/thread-activity-types.js
--- a/lib/types/thread-activity-types.js
+++ b/lib/types/thread-activity-types.js
@@ -5,7 +5,7 @@
export type ThreadActivityStoreEntry = {
+lastNavigatedTo: number, // millisecond timestamp
- +lastPruned: number, // millisecond timestamp
+ +lastPruned?: number, // millisecond timestamp
};
export type ThreadActivityStore = {
+[threadID: string]: ThreadActivityStoreEntry,

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 5:21 AM (21 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2610388
Default Alt Text
D11622.id38991.diff (1 KB)

Event Timeline