From 4e170f0b692f06e2806dbbc654b1f0788e12cba8 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Wed, 25 Mar 2026 01:54:36 +0100 Subject: [PATCH] feat(social): add TaggedUser type and origin-tag searchUsers results --- packages/web/src/stores/socialStore.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/web/src/stores/socialStore.ts b/packages/web/src/stores/socialStore.ts index 96f3f2e4..cca77eaf 100644 --- a/packages/web/src/stores/socialStore.ts +++ b/packages/web/src/stores/socialStore.ts @@ -26,6 +26,7 @@ export class InstanceDisconnectedError extends Error { export type TaggedFriend = Friend & { _instanceOrigin: string }; export type TaggedFriendRequest = FriendRequest & { _instanceOrigin: string }; +export type TaggedUser = User & { _instanceOrigin: string }; // ─── Helpers ───────────────────────────────────────────────────────────────── @@ -48,7 +49,7 @@ interface SocialState { updateFriendRequest: (id: string, status: 'accepted' | 'declined') => Promise; cancelFriendRequest: (id: string) => Promise; removeFriend: (id: string) => Promise; - searchUsers: (query: string) => Promise; + searchUsers: (query: string) => Promise; addIncomingRequest: (request: FriendRequest, origin: string) => void; addFriendFromAccepted: (friend: Friend, requestId: string, origin: string) => void; updateFriendPresence: (userId: string, status: string) => void; @@ -253,7 +254,7 @@ export const useSocialStore = create((set, get) => ({ const results = await Promise.allSettled(searches.map(s => s.promise)); - const allUsers: User[] = []; + const allUsers: TaggedUser[] = []; const seen = new Set(); results.forEach((result, i) => { @@ -264,7 +265,7 @@ export const useSocialStore = create((set, get) => ({ if (seen.has(dedupeKey)) continue; seen.add(dedupeKey); if (origin) normalizeUserAssets(user, origin); - allUsers.push(user); + allUsers.push({ ...user, _instanceOrigin: origin }); } });