mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-20 02:00:49 +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[] }) {
|
function TwitchEventLog({ events }: { events: EventSubNotification[] }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
console.log(events);
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SectionHeader>
|
<SectionHeader>
|
||||||
|
@ -351,7 +350,9 @@ function TwitchEventLog({ events }: { events: EventSubNotification[] }) {
|
||||||
<EventListContainer>
|
<EventListContainer>
|
||||||
{events
|
{events
|
||||||
.filter((ev) => supportedMessages.includes(ev.subscription.type))
|
.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) => (
|
.map((ev) => (
|
||||||
<TwitchEvent key={`${ev.subscription.id}-${ev.date}`} data={ev} />
|
<TwitchEvent key={`${ev.subscription.id}-${ev.date}`} data={ev} />
|
||||||
))}
|
))}
|
||||||
|
|
Loading…
Reference in a new issue