Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3399931
D11622.id38991.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11622.id38991.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11622: [lib] Make `lastPruned` and `lastNavigatedTo` type optional for thread activity entry
Attached
Detach File
Event Timeline
Log In to Comment