Skip to content

Commit

Permalink
fix: waline comment data could return without time field (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyxguo committed Sep 16, 2023
1 parent daa6a76 commit c213819
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/comments/waline-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class WalineComments {
mapComment(comment: WalineComment): RecentComments {
// slice off the last 5 character to remove the timezone.
const createdAt = formatTime(
new Date(comment.time).toISOString().slice(0, -5),
new Date(comment.time ?? comment.insertedAt).toISOString().slice(0, -5),
{
lang: this.configs.lang
}
Expand Down

0 comments on commit c213819

Please sign in to comment.