forked from Kieran/zap.stream
fix: mutes when no kind 10_000
This commit is contained in:
parent
474f6c0f61
commit
af14b92ab4
@ -5,7 +5,7 @@ import { MUTED } from "const";
|
|||||||
|
|
||||||
export function LoggedInMuteButton({ pubkey }: { pubkey: string }) {
|
export function LoggedInMuteButton({ pubkey }: { pubkey: string }) {
|
||||||
const login = useLogin();
|
const login = useLogin();
|
||||||
const { tags, content, timestamp } = login!.muted;
|
const { tags, content } = login!.muted;
|
||||||
const muted = tags.filter((t) => t.at(0) === "p");
|
const muted = tags.filter((t) => t.at(0) === "p");
|
||||||
const isMuted = muted.find((t) => t.at(1) === pubkey);
|
const isMuted = muted.find((t) => t.at(1) === pubkey);
|
||||||
|
|
||||||
@ -45,10 +45,9 @@ export function LoggedInMuteButton({ pubkey }: { pubkey: string }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<AsyncButton
|
<AsyncButton
|
||||||
disabled={timestamp ? timestamp === 0 : true}
|
|
||||||
type="button"
|
type="button"
|
||||||
className="btn delete-button"
|
className="btn delete-button"
|
||||||
onClick={isMuted ? unmute : mute}
|
onClick={() => isMuted ? unmute() : mute()}
|
||||||
>
|
>
|
||||||
{isMuted ? "Unmute" : "Mute"}
|
{isMuted ? "Unmute" : "Mute"}
|
||||||
</AsyncButton>
|
</AsyncButton>
|
||||||
|
Loading…
Reference in New Issue
Block a user