Fixed long history rendering

This commit is contained in:
Selim Mustafaev 2025-05-22 22:58:17 +03:00
parent c4e28a0656
commit b7439b144a
3 changed files with 14 additions and 13 deletions

View File

@ -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;

View File

@ -26,12 +26,9 @@ 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)
}
} else {
vehicleCell(vehicle)
.onTapGesture {
viewModel.openVehicleDetail(vehicle)
}
}
}

View File

@ -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)
}