diff --git a/LegacyComponents/TGLocationPulseView.m b/LegacyComponents/TGLocationPulseView.m index ff21c9749e..050f8d8fd0 100644 --- a/LegacyComponents/TGLocationPulseView.m +++ b/LegacyComponents/TGLocationPulseView.m @@ -31,6 +31,9 @@ { _circleLayer.hidden = false; + if (_circleLayer.animationKeys.count > 0) + return; + CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; scaleAnimation.values = @[@0.0f, @0.72f, @1.0f, @1.0f]; scaleAnimation.keyTimes = @[@0.0, @0.49f, @0.88f, @1.0f]; diff --git a/LegacyComponents/TGLocationViewController.m b/LegacyComponents/TGLocationViewController.m index df75ed6f19..e9b3a95fbd 100644 --- a/LegacyComponents/TGLocationViewController.m +++ b/LegacyComponents/TGLocationViewController.m @@ -46,6 +46,7 @@ TGLocationAnnotation *_annotation; UIBarButtonItem *_actionsBarItem; + bool _didSetRightBarButton; SVariable *_reloadReady; SMetaDisposable *_reloadDisposable; @@ -64,7 +65,6 @@ bool _selectedCurrentLiveLocation; bool _focusOnOwnLocation; - TGLocationPinAnnotationView *_ownLiveLocationView; __weak MKAnnotationView *_userLocationView; } @@ -245,7 +245,11 @@ { if ([self hasMoreThanOneLocation]) { - [self setRightBarButtonItem:_actionsBarItem animated:true]; + if (!_didSetRightBarButton) + { + _didSetRightBarButton = true; + [self setRightBarButtonItem:_actionsBarItem animated:true]; + } if (actual && self.zoomToFitAllLocationsOnScreen) { @@ -263,7 +267,11 @@ } else { - [self setRightBarButtonItem:nil animated:true]; + if (_didSetRightBarButton) + { + _didSetRightBarButton = false; + [self setRightBarButtonItem:nil animated:true]; + } } }