feat: Implement sub-room functionality
- Added support for sub-rooms in the SpaceHierarchy component, allowing rooms to have nested child rooms. - Introduced UnjoinedSubRoomItem component to display unjoined sub-rooms with a join button. - Created SubRooms settings page for managing sub-rooms, including adding and removing sub-rooms. - Updated RoomNavItem to include options for creating sub-rooms. - Enhanced room fetching logic to filter out sub-rooms from the main room list. - Added hooks for managing sub-rooms state and permissions. - Updated relevant state management to handle sub-room creation and association with parent rooms.
This commit is contained in:
@@ -494,9 +494,16 @@ function ProfileBanner({ avatarRef, nameRef }: { avatarRef: React.RefObject<HTML
|
||||
if (!httpUrl) throw new Error('Could not resolve uploaded avatar URL');
|
||||
|
||||
const accessToken = mx.getAccessToken();
|
||||
const response = await fetch(httpUrl, {
|
||||
let response = await fetch(httpUrl, {
|
||||
headers: accessToken && useAuthentication ? { Authorization: `Bearer ${accessToken}` } : undefined,
|
||||
});
|
||||
|
||||
// If we got a 401 and we tried with auth, fallback to unauthenticated request
|
||||
if (!response.ok && response.status === 401 && accessToken && useAuthentication) {
|
||||
console.warn('[Profile] Auth failed (401), attempting unauthenticated fallback for avatar fetch');
|
||||
response = await fetch(httpUrl);
|
||||
}
|
||||
|
||||
if (!response.ok) throw new Error('Failed to fetch uploaded avatar');
|
||||
const avatarData = await response.arrayBuffer();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user