Fail to open a sub space #5965 (#6080)

* Fail to open a sub space #5965

- Fixed
This commit is contained in:
Gil Eluard
2022-05-03 11:22:15 +02:00
committed by GitHub
parent 5224a56ec7
commit cbe2e135ba
7 changed files with 185 additions and 21 deletions
+17 -1
View File
@@ -723,8 +723,24 @@
- (void)filterRoomsWithParentId:(NSString*)roomParentId
inMatrixSession:(MXSession*)mxSession
{
titleView.subtitleLabel.text = roomParentId ? [mxSession roomSummaryWithRoomId:roomParentId].displayname : nil;
if (roomParentId) {
NSString *parentName = [mxSession roomSummaryWithRoomId:roomParentId].displayname;
NSMutableArray<NSString *> *breadcrumbs = [[NSMutableArray alloc] initWithObjects:parentName, nil];
MXSpace *firstRootAncestor = roomParentId ? [mxSession.spaceService firstRootAncestorForRoomWithId:roomParentId] : nil;
NSString *rootName = nil;
if (firstRootAncestor)
{
rootName = [mxSession roomSummaryWithRoomId:firstRootAncestor.spaceId].displayname;
[breadcrumbs insertObject:rootName atIndex:0];
}
titleView.breadcrumbView.breadcrumbs = breadcrumbs;
}
else
{
titleView.breadcrumbView.breadcrumbs = @[];
}
recentsDataSource.currentSpace = [mxSession.spaceService getSpaceWithId:roomParentId];
[self updateSideMenuNotifcationIcon];
}