add guard to avoid redundant show, fix logic in existing guard when

hiding.

// FREEBIE
This commit is contained in:
Michael Kirk 2018-05-16 10:28:51 -04:00 committed by Matthew Chen
parent 2258e18d34
commit ffe17a3fcc

View file

@ -330,6 +330,11 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
{
OWSAssertIsOnMainThread();
if (!self.returnToCallWindow.hidden) {
return;
}
DDLogInfo(@"%@ showing 'return to call' window.", self.logTag);
self.returnToCallWindow.hidden = NO;
[self.returnToCallViewController startAnimating];
}
@ -338,10 +343,11 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void)
{
OWSAssertIsOnMainThread();
if (!self.returnToCallWindow.hidden) {
DDLogInfo(@"%@ hiding 'return to call' window.", self.logTag);
if (self.returnToCallWindow.hidden) {
return;
}
DDLogInfo(@"%@ hiding 'return to call' window.", self.logTag);
self.returnToCallWindow.hidden = YES;
[self.returnToCallViewController stopAnimating];
}