Fix expiration check

This commit is contained in:
Kieran 2023-09-19 13:00:02 +01:00
parent 6c127d4e9b
commit ed50749368
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -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>}