flipkart-incubator / fk-ios-chatheads

Apache License 2.0
58 stars 18 forks source link

Chat Heads reappearing after being dismissed? #4

Open willsmillie opened 6 years ago

willsmillie commented 6 years ago

Hi, I've implemented this pod in an app and some users have reported that after dismissing the chat heads, they will pop back up... Any ideas as to what might be causing this?

willsmillie commented 6 years ago

Found the problem. the pendingChathHeads array is never unset.

Fixed it by adding the following code in - (void)setChatHeadsMoving:(BOOL)chatHeadsMoving

            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                dispatch_async(dispatch_get_main_queue(), ^{
                    [self presentChatHeads:[self.pendingChatHeads copy] animated:YES];
                    self.pendingChatHeads =  [[NSMutableArray alloc] init];
                });
            });