fix: hide badge awards outside stream ends

This commit is contained in:
kieran 2024-09-17 12:15:56 +01:00
parent c6d109f182
commit 031a223995
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -109,7 +109,7 @@ export function LiveChat({
extra.push({ kind: -2, created_at: Number(ends) } as TaggedNostrEvent); extra.push({ kind: -2, created_at: Number(ends) } as TaggedNostrEvent);
} }
return removeUndefined([...feed, ...awards.map(a => a.event), ...extra]) return removeUndefined([...feed, ...awards.map(a => a.event), ...extra])
.filter(a => a.created_at >= started) .filter(a => a.created_at >= started && (!ends || a.created_at <= Number(ends)))
.sort((a, b) => b.created_at - a.created_at); .sort((a, b) => b.created_at - a.created_at);
}, [feed, awards]); }, [feed, awards]);