Skip to content

Commit

Permalink
🎨 [nico] date_usecがない旧実況過去ログを参照した時の挙動を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
ci7lus committed Aug 25, 2022
1 parent f38f6a9 commit 0d62571
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/miraktest-nico/streams/Kakolog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,15 @@ export const KakologStream = ({
...data.packet.map((packet) => {
const { chat } = packet
const date = parseInt(chat.date)
const date_usec = parseInt(chat.date_usec)
const date_usec = parseInt(chat.date_usec || "NaN")
return {
...packet.chat,
no: parseInt(chat.no),
date,
date_usec,
vpos: parseInt(chat.vpos),
time: date * 1000 + date_usec / 1000,
// TODO: vpos合わせ 朝4時リセット
time: date * 1000 + (date_usec ? date_usec / 1000 : 0),
}
}),
].sort((a, b) => a.time - b.time)
Expand Down
2 changes: 1 addition & 1 deletion src/miraktest-nico/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type NicoLogComment = {
no: string
vpos: string
date: string
date_usec: string
date_usec?: string
mail: string
user_id: string
anonymity: string
Expand Down

0 comments on commit 0d62571

Please sign in to comment.