From 8fdc7a8e1e8746163c5a3cc5224fb183dfb51afb Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Tue, 26 Oct 2021 03:15:41 +0400 Subject: [PATCH] Fix live location directions buttons --- submodules/LocationUI/Sources/LocationLiveListItem.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/submodules/LocationUI/Sources/LocationLiveListItem.swift b/submodules/LocationUI/Sources/LocationLiveListItem.swift index 7dc129b979..c42ffcfd35 100644 --- a/submodules/LocationUI/Sources/LocationLiveListItem.swift +++ b/submodules/LocationUI/Sources/LocationLiveListItem.swift @@ -339,7 +339,7 @@ final class LocationLiveListItemNode: ListViewItemNode { if case let .ready(drivingTime) = item.drivingTime { strongSelf.drivingButtonNode?.title = stringForEstimatedDuration(strings: item.presentationData.strings, time: drivingTime, format: { $0 }) - if currentItem?.drivingTime == nil { + if let previousDrivingTime = currentItem?.drivingTime, case .calculating = previousDrivingTime { strongSelf.drivingButtonNode?.alpha = 1.0 strongSelf.drivingButtonNode?.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2) } @@ -348,7 +348,7 @@ final class LocationLiveListItemNode: ListViewItemNode { if case let .ready(transitTime) = item.transitTime { strongSelf.transitButtonNode?.title = stringForEstimatedDuration(strings: item.presentationData.strings, time: transitTime, format: { $0 }) - if currentItem?.transitTime == nil { + if let previousTransitTime = currentItem?.transitTime, case .calculating = previousTransitTime { strongSelf.transitButtonNode?.alpha = 1.0 strongSelf.transitButtonNode?.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2) } @@ -357,7 +357,7 @@ final class LocationLiveListItemNode: ListViewItemNode { if case let .ready(walkingTime) = item.walkingTime { strongSelf.walkingButtonNode?.title = stringForEstimatedDuration(strings: item.presentationData.strings, time: walkingTime, format: { $0 }) - if currentItem?.walkingTime == nil { + if let previousWalkingTime = currentItem?.walkingTime, case .calculating = previousWalkingTime { strongSelf.walkingButtonNode?.alpha = 1.0 strongSelf.walkingButtonNode?.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2) }