mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-04 03:58:11 +00:00
fix: carprops
This commit is contained in:
@@ -133,12 +133,12 @@ export function carDataList(state: IStore) {
|
|||||||
return Object.keys(stockData.info).reduce((acc, vehicleTypeKey) => {
|
return Object.keys(stockData.info).reduce((acc, vehicleTypeKey) => {
|
||||||
if (!vehicleTypeKey.startsWith('car')) return acc;
|
if (!vehicleTypeKey.startsWith('car')) return acc;
|
||||||
|
|
||||||
const carVehiclesData = (stockData.info)[vehicleTypeKey as TStockInfoKey];
|
const carVehiclesData = stockData.info[vehicleTypeKey as TStockInfoKey];
|
||||||
|
|
||||||
carVehiclesData.forEach((car) => {
|
carVehiclesData.forEach((car) => {
|
||||||
if (state.showSupporter && !car[3]) return;
|
if (state.showSupporter && !car[3]) return;
|
||||||
|
|
||||||
const carPropsData = stockData.props.find((v) => car[0].toString().includes(v.type));
|
const carPropsData = stockData.props.find((v) => car[0].toString().startsWith(v.type));
|
||||||
|
|
||||||
acc.push({
|
acc.push({
|
||||||
useType: vehicleTypeKey as 'car-passenger' | 'car-cargo',
|
useType: vehicleTypeKey as 'car-passenger' | 'car-cargo',
|
||||||
@@ -148,7 +148,7 @@ export function carDataList(state: IStore) {
|
|||||||
supportersOnly: car[3] as boolean,
|
supportersOnly: car[3] as boolean,
|
||||||
maxSpeed: Number(car[4] as string),
|
maxSpeed: Number(car[4] as string),
|
||||||
imageSrc: car[5] as string,
|
imageSrc: car[5] as string,
|
||||||
cargoList: carPropsData?.cargo.includes(';')
|
cargoList: carPropsData?.cargo.split(';').filter((s) => s.length > 0)
|
||||||
? carPropsData.cargo.split(';').map((cargo) => ({
|
? carPropsData.cargo.split(';').map((cargo) => ({
|
||||||
id: cargo.split(':')[0],
|
id: cargo.split(':')[0],
|
||||||
totalMass: Number(cargo.split(':')[1]),
|
totalMass: Number(cargo.split(':')[1]),
|
||||||
@@ -327,5 +327,3 @@ export function chosenRealStock(state: IStore) {
|
|||||||
// }),
|
// }),
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user