Skip to content

Commit

Permalink
BF: Cannot join from a room preview for room with a long topic (#1645)
Browse files Browse the repository at this point in the history
If necessary, crop the room name in "You are trying to access %@. Would you like to join in order to participate in the discussion?" so that it does not eat all the screen.
  • Loading branch information
manuroe committed Mar 9, 2018
1 parent 8c9c075 commit c5aab87
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Riot/Views/RoomTitle/PreviewRoomTitleView.m
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ - (void)refreshDisplay
{
roomName = NSLocalizedStringFromTable(@"room_preview_try_join_an_unknown_room_default", @"Vector", nil);
}
else if (roomName.length > 20)
{
// Would have nice to get the cropped string displayed by self.displayNameTextField
// but the value is not accessible. Cut it off by hand
roomName = [NSString stringWithFormat:@"%@",[roomName substringToIndex:20]];
}

self.previewLabel.text = [NSString stringWithFormat:NSLocalizedStringFromTable(@"room_preview_try_join_an_unknown_room", @"Vector", nil), roomName];
}
}
Expand Down

0 comments on commit c5aab87

Please sign in to comment.