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 }); } });