forked from Kieran/zap.stream
Fix expiration check
This commit is contained in:
parent
6c127d4e9b
commit
ed50749368
@ -10,10 +10,9 @@ export function Music({ link }: { link: NostrLink }) {
|
||||
const nowPlaying = useStatus("music", host, true);
|
||||
const cover = nowPlaying && findTag(nowPlaying, "cover");
|
||||
const expiry = nowPlaying && findTag(nowPlaying, "expiration");
|
||||
const isExpired = expiry && Number(expiry) > unixNow();
|
||||
const isExpired = expiry && Number(expiry) < unixNow();
|
||||
return (
|
||||
nowPlaying &&
|
||||
!isExpired && (
|
||||
(nowPlaying && !isExpired) && (
|
||||
<div className="music">
|
||||
{cover && <img className="cover" src={cover} alt={nowPlaying.content} />}
|
||||
{nowPlaying && <p className="track">🎵 {nowPlaying.content}</p>}
|
||||
|
Loading…
Reference in New Issue
Block a user