mirror of
https://github.com/block/buzz.git
synced 2026-11-03 07:51:22 +00:00
fix(sidebar): use declared owner helper for working pill
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
committed by
npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f
parent
4535a42323
commit
a8d1501979
@@ -11,6 +11,7 @@ import {
|
||||
} from "@/features/agents/hooks";
|
||||
import { useManagedAgentObserverBridge } from "@/features/agents/observerRelayStore";
|
||||
import { useUsersBatchQuery } from "@/features/profile/hooks";
|
||||
import { ownsAuthorAgent } from "@/features/profile/lib/identity";
|
||||
import { useIdentityQuery } from "@/shared/api/hooks";
|
||||
import type {
|
||||
ManagedAgent,
|
||||
@@ -49,11 +50,9 @@ export function getOwnedRelayWorkingAgents(
|
||||
): OwnedRelayWorkingAgent[] {
|
||||
if (!currentPubkey) return [];
|
||||
|
||||
const normalizedCurrentPubkey = normalizePubkey(currentPubkey);
|
||||
return relayAgents.flatMap((agent) => {
|
||||
const profile = profiles?.[normalizePubkey(agent.pubkey)];
|
||||
if (!profile?.ownerPubkey) return [];
|
||||
if (normalizePubkey(profile.ownerPubkey) !== normalizedCurrentPubkey) {
|
||||
if (!ownsAuthorAgent(profile, currentPubkey)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user