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:
npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w
2026-06-30 17:01:29 -07:00
committed by npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f
parent 4535a42323
commit a8d1501979

View File

@@ -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 [];
}