File tree 2 files changed +1
-13
lines changed
2 files changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -464,16 +464,6 @@ describe('utils/helpers.ts', () => {
464
464
} ) ;
465
465
466
466
describe ( 'formatNotificationUpdatedAt' , ( ) => {
467
- it ( 'should use last_read_at if available' , ( ) => {
468
- const notification = {
469
- ...mockSingleNotification ,
470
- last_read_at : '2021-06-23T16:00:00Z' ,
471
- updated_at : '2021-06-23T17:00:00Z' ,
472
- } ;
473
-
474
- expect ( formatNotificationUpdatedAt ( notification ) ) . toContain ( 'ago' ) ;
475
- } ) ;
476
-
477
467
it ( 'should use updated_at if last_read_at is null' , ( ) => {
478
468
const notification = {
479
469
...mockSingleNotification ,
Original file line number Diff line number Diff line change @@ -157,10 +157,8 @@ export function formatForDisplay(text: string[]): string {
157
157
export function formatNotificationUpdatedAt (
158
158
notification : Notification ,
159
159
) : string {
160
- const date = notification . last_read_at ?? notification . updated_at ;
161
-
162
160
try {
163
- return formatDistanceToNowStrict ( parseISO ( date ) , {
161
+ return formatDistanceToNowStrict ( parseISO ( notification . updated_at ) , {
164
162
addSuffix : true ,
165
163
} ) ;
166
164
} catch ( e ) { }
You can’t perform that action at this time.
0 commit comments