mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-18 01:50:50 +00:00
fix: use event date for sorting recent events
This commit is contained in:
parent
4f0cc8e570
commit
eaa3619a45
1 changed files with 3 additions and 2 deletions
|
@ -335,7 +335,6 @@ function TwitchEvent({ data }: { data: EventSubNotification }) {
|
|||
|
||||
function TwitchEventLog({ events }: { events: EventSubNotification[] }) {
|
||||
const { t } = useTranslation();
|
||||
console.log(events);
|
||||
return (
|
||||
<>
|
||||
<SectionHeader>
|
||||
|
@ -351,7 +350,9 @@ function TwitchEventLog({ events }: { events: EventSubNotification[] }) {
|
|||
<EventListContainer>
|
||||
{events
|
||||
.filter((ev) => supportedMessages.includes(ev.subscription.type))
|
||||
.reverse()
|
||||
.sort((a, b) =>
|
||||
a.date && b.date ? Date.parse(b.date) - Date.parse(a.date) : 0,
|
||||
)
|
||||
.map((ev) => (
|
||||
<TwitchEvent key={`${ev.subscription.id}-${ev.date}`} data={ev} />
|
||||
))}
|
||||
|
|
Loading…
Reference in a new issue