Remove unnecessary nonnull assertions

This commit is contained in:
Alexander Skvortsov 2021-11-21 19:54:37 -05:00
parent 2a7183b0a4
commit 11a72f8450

View File

@ -222,7 +222,7 @@ export default class DiscussionPage<CustomAttrs extends IDiscussionPageAttrs = I
record.relationships.discussion.data.id === discussionId
)
.map((record) => app.store.getById<Post>('posts', record.id))
.sort((a?: Post, b?: Post) => a?.createdAt()?.getTime()! - b?.createdAt()?.getTime()!)
.sort((a?: Post, b?: Post) => (a?.createdAt()?.getTime() ?? 0) - (b?.createdAt()?.getTime() ?? 0))
.slice(0, 20);
}