Fixed long history rendering
This commit is contained in:
parent
c4e28a0656
commit
b7439b144a
@ -1661,7 +1661,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 167;
|
||||
CURRENT_PROJECT_VERSION = 168;
|
||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = AutoCat;
|
||||
@ -1690,7 +1690,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 167;
|
||||
CURRENT_PROJECT_VERSION = 168;
|
||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = AutoCat;
|
||||
|
||||
@ -26,13 +26,10 @@ struct HistoryScreen: View {
|
||||
ForEach(viewModel.vehicleSections) { section in
|
||||
Section(header: Text(section.header)) {
|
||||
ForEach(section.elements) { vehicle in
|
||||
if Device.isIPhone {
|
||||
NavigationLink(value: HistoryRoute.localReport(vehicle)) {
|
||||
vehicleCell(vehicle)
|
||||
vehicleCell(vehicle)
|
||||
.onTapGesture {
|
||||
viewModel.openVehicleDetail(vehicle)
|
||||
}
|
||||
} else {
|
||||
vehicleCell(vehicle)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,11 +145,7 @@ final class HistoryViewModel: ACHudContainer {
|
||||
if errors.isEmpty {
|
||||
hud = nil
|
||||
if !vehicle.unrecognized {
|
||||
if Device.isIPhone {
|
||||
Router.shared.openLocalReport(vehicle: vehicle)
|
||||
} else {
|
||||
selectedVehicleId = vehicle.id
|
||||
}
|
||||
openVehicleDetail(vehicle)
|
||||
}
|
||||
} else {
|
||||
showErrors(errors)
|
||||
@ -159,6 +155,14 @@ final class HistoryViewModel: ACHudContainer {
|
||||
}
|
||||
}
|
||||
|
||||
func openVehicleDetail(_ vehicle: VehicleDto) {
|
||||
if Device.isIPhone {
|
||||
Router.shared.openLocalReport(vehicle: vehicle)
|
||||
} else {
|
||||
selectedVehicleId = vehicle.id
|
||||
}
|
||||
}
|
||||
|
||||
func checkNewNumber(_ number: String) async {
|
||||
await checkVehicle(number: number, type: .normal)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user