fix: artists search marks already-followed artists instead of a Follow button

This commit is contained in:
Jonathan
2026-07-11 17:50:53 +02:00
parent aafd8b15d5
commit 28fc1ee1a8
+7 -1
View File
@@ -64,6 +64,8 @@ export function ArtistsClient() {
refresh();
}
const followedMbids = new Set(artists.map((a) => a.mbid));
return (
<div>
<form onSubmit={search}>
@@ -77,7 +79,11 @@ export function ArtistsClient() {
<li key={h.mbid}>
{h.name}
{h.disambiguation ? ` (${h.disambiguation})` : ""}{" "}
<button onClick={() => follow(h)}>Follow</button>
{followedMbids.has(h.mbid) ? (
<span> · following</span>
) : (
<button onClick={() => follow(h)}>Follow</button>
)}
</li>
))}
</ul>