fix: federated leaveSpace 403 and context menu for owner spaces

Use getMyUserIdForOrigin() in leaveSpace() so federated spaces send
the correct remote user ID instead of the home ID. Show context menu
for all spaces with "Invite People" action; "Leave Space" only for
non-owners.
This commit is contained in:
Jannis Braun
2026-03-11 17:45:50 +01:00
parent 3eabfb9da9
commit b709862741
2 changed files with 42 additions and 16 deletions
+1 -1
View File
@@ -239,7 +239,7 @@ export const useSpaceStore = create<SpaceState>((set, get) => ({
const space = get().spaces.find(s => s.id === spaceId);
const origin = (space as TaggedSpace)?._instanceOrigin ?? '';
const targetApi = getApiForOrigin(origin);
const userId = useAuthStore.getState().user?.id;
const userId = getMyUserIdForOrigin(origin);
if (!userId) return;
await targetApi.spaces.removeMember(spaceId, userId);
set((state) => ({