fix: Update compatible motor identifiers in power supplies data
- Changed compatible motor identifier from "42AIM30" to "42AIM" in power supplies JSON to ensure consistency and accuracy in motor compatibility listings.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useState, useEffect, useMemo } from 'react';
|
||||
import partsData from '../../data/index.js';
|
||||
import { getPriceDisplayFromLinksAsync } from '../../utils/bomUtils';
|
||||
import { useCurrency } from '../../contexts/CurrencyContext';
|
||||
@@ -16,10 +16,12 @@ export default function PowerSupplyStep({ config, updateConfig }) {
|
||||
};
|
||||
|
||||
// Filter compatible power supplies
|
||||
const compatiblePowerSupplies = partsData.powerSupplies.filter((psu) => {
|
||||
if (!selectedMotorId) return true;
|
||||
return psu.compatibleMotors.includes(selectedMotorId);
|
||||
});
|
||||
const compatiblePowerSupplies = useMemo(() => {
|
||||
return partsData.powerSupplies.filter((psu) => {
|
||||
if (!selectedMotorId) return true;
|
||||
return psu.compatibleMotors.includes(selectedMotorId);
|
||||
});
|
||||
}, [selectedMotorId]);
|
||||
|
||||
useEffect(() => {
|
||||
const updatePrices = async () => {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"image": "/images/power-supplies/24v-PSU.png",
|
||||
"compatibleMotors": [
|
||||
"57AIM30",
|
||||
"42AIM30",
|
||||
"42AIM",
|
||||
"iHSV57"
|
||||
],
|
||||
"required": true,
|
||||
@@ -51,7 +51,7 @@
|
||||
"image": "/images/power-supplies/24v-usbc-pd.png",
|
||||
"compatibleMotors": [
|
||||
"57AIM30",
|
||||
"42AIM30",
|
||||
"42AIM",
|
||||
"iHSV57"
|
||||
],
|
||||
"required": true,
|
||||
|
||||
Reference in New Issue
Block a user