Code cleaning: prevent from multiple copy of the bubble components.

This commit is contained in:
giomfo
2016-10-12 15:04:55 +02:00
parent f4ff36673d
commit d209194a74
2 changed files with 22 additions and 12 deletions
+7 -4
View File
@@ -131,11 +131,12 @@
bubbleCell.bubbleOverlayContainer.userInteractionEnabled = NO;
bubbleCell.bubbleOverlayContainer.hidden = NO;
NSInteger index = cellData.bubbleComponents.count;
NSArray *bubbleComponents = cellData.bubbleComponents;
NSInteger index = bubbleComponents.count;
CGFloat bottomPositionY = bubbleCell.frame.size.height;
while (index--)
{
MXKRoomBubbleComponent *component = cellData.bubbleComponents[index];
MXKRoomBubbleComponent *component = bubbleComponents[index];
if (component.event.mxkState != MXKEventStateSendingFailed)
{
@@ -246,10 +247,12 @@
// Manage initial event (case of permalink or search result)
if (self.timeline.initialEventId)
{
NSArray *bubbleComponents = cellData.bubbleComponents;
// Check if the cell contains this initial event
for (NSUInteger index = 0; index < cellData.bubbleComponents.count; index++)
for (NSUInteger index = 0; index < bubbleComponents.count; index++)
{
MXKRoomBubbleComponent *component = cellData.bubbleComponents[index];
MXKRoomBubbleComponent *component = bubbleComponents[index];
if ([component.event.eventId isEqualToString:self.timeline.initialEventId])
{