mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
5982: Rename action
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ final class StaticLocationViewingCoordinator: Coordinator, Presentable {
|
||||
guard let self = self else { return }
|
||||
MXLog.debug("[StaticLocationSharingViewerCoordinator] StaticLocationSharingViewerViewModel did complete with result: \(result).")
|
||||
switch result {
|
||||
case .cancel:
|
||||
case .close:
|
||||
self.completion?()
|
||||
case .share(let coordinate):
|
||||
self.presentLocationActivityController(with: coordinate)
|
||||
|
||||
+2
-2
@@ -21,12 +21,12 @@ import CoreLocation
|
||||
// MARK: View model
|
||||
|
||||
enum StaticLocationViewingViewAction {
|
||||
case cancel
|
||||
case close
|
||||
case share
|
||||
}
|
||||
|
||||
enum StaticLocationViewingViewModelResult {
|
||||
case cancel
|
||||
case close
|
||||
case share(_ coordinate: CLLocationCoordinate2D)
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -63,8 +63,8 @@ class StaticLocationViewingViewModel: StaticLocationViewingViewModelType, Static
|
||||
|
||||
override func process(viewAction: StaticLocationViewingViewAction) {
|
||||
switch viewAction {
|
||||
case .cancel:
|
||||
completion?(.cancel)
|
||||
case .close:
|
||||
completion?(.close)
|
||||
case .share:
|
||||
completion?(.share(state.sharedAnnotation.coordinate))
|
||||
}
|
||||
@@ -78,7 +78,7 @@ class StaticLocationViewingViewModel: StaticLocationViewingViewModelType, Static
|
||||
}
|
||||
|
||||
let alertInfo = mapViewErrorAlertInfoBuilder.build(with: error) { [weak self] in
|
||||
self?.completion?(.cancel)
|
||||
self?.completion?(.close)
|
||||
}
|
||||
|
||||
state.bindings.alertInfo = alertInfo
|
||||
|
||||
+3
-3
@@ -46,12 +46,12 @@ class StaticLocationViewingViewModelTests: XCTestCase {
|
||||
switch result {
|
||||
case .share:
|
||||
XCTFail()
|
||||
case .cancel:
|
||||
case .close:
|
||||
expectation.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.context.send(viewAction: .cancel)
|
||||
viewModel.context.send(viewAction: .close)
|
||||
|
||||
waitForExpectations(timeout: 3)
|
||||
}
|
||||
@@ -67,7 +67,7 @@ class StaticLocationViewingViewModelTests: XCTestCase {
|
||||
XCTAssertEqual(coordinate.latitude, viewModel.context.viewState.sharedAnnotation.coordinate.latitude)
|
||||
XCTAssertEqual(coordinate.longitude, viewModel.context.viewState.sharedAnnotation.coordinate.longitude)
|
||||
expectation.fulfill()
|
||||
case .cancel:
|
||||
case .close:
|
||||
XCTFail()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ struct StaticLocationView: View {
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button(VectorL10n.cancel, action: {
|
||||
viewModel.send(viewAction: .cancel)
|
||||
viewModel.send(viewAction: .close)
|
||||
})
|
||||
}
|
||||
ToolbarItem(placement: .principal) {
|
||||
|
||||
Reference in New Issue
Block a user