fix: mutes when no kind 10_000

This commit is contained in:
Kieran 2023-08-02 15:35:40 +01:00
parent 474f6c0f61
commit af14b92ab4
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -5,7 +5,7 @@ import { MUTED } from "const";
export function LoggedInMuteButton({ pubkey }: { pubkey: string }) {
const login = useLogin();
const { tags, content, timestamp } = login!.muted;
const { tags, content } = login!.muted;
const muted = tags.filter((t) => t.at(0) === "p");
const isMuted = muted.find((t) => t.at(1) === pubkey);
@ -45,10 +45,9 @@ export function LoggedInMuteButton({ pubkey }: { pubkey: string }) {
return (
<AsyncButton
disabled={timestamp ? timestamp === 0 : true}
type="button"
className="btn delete-button"
onClick={isMuted ? unmute : mute}
onClick={() => isMuted ? unmute() : mute()}
>
{isMuted ? "Unmute" : "Mute"}
</AsyncButton>