Delay local updating proximity radius state reset

This commit is contained in:
Ilya Laktyushin 2020-10-29 04:32:01 +04:00
parent 3ccf64e63f
commit 968e59077f

View File

@ -194,11 +194,13 @@ public final class LocationViewController: ViewController {
guard let strongSelf = self else { guard let strongSelf = self else {
return return
} }
Queue.mainQueue().after(0.5) {
strongSelf.controllerNode.updateState { state in strongSelf.controllerNode.updateState { state in
var state = state var state = state
state.cancellingProximityRadius = false state.cancellingProximityRadius = false
return state return state
} }
}
}) })
} }
} else { } else {
@ -244,11 +246,13 @@ public final class LocationViewController: ViewController {
guard let strongSelf = self else { guard let strongSelf = self else {
return return
} }
Queue.mainQueue().after(0.5) {
strongSelf.controllerNode.updateState { state in strongSelf.controllerNode.updateState { state in
var state = state var state = state
state.updatingProximityRadius = nil state.updatingProximityRadius = nil
return state return state
} }
}
}) })
} else { } else {
strongSelf.present(textAlertController(context: strongSelf.context, title: strongSelf.presentationData.strings.Location_LiveLocationRequired_Title, text: strongSelf.presentationData.strings.Location_LiveLocationRequired_Description, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Location_LiveLocationRequired_ShareLocation, action: { strongSelf.present(textAlertController(context: strongSelf.context, title: strongSelf.presentationData.strings.Location_LiveLocationRequired_Title, text: strongSelf.presentationData.strings.Location_LiveLocationRequired_Description, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Location_LiveLocationRequired_ShareLocation, action: {