From ea083485d58b639e352062e9034d47de8e51f8d1 Mon Sep 17 00:00:00 2001 From: MunchDev-oss Date: Sat, 10 Jan 2026 03:53:56 -0500 Subject: [PATCH] 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. --- website/src/components/steps/PowerSupplyStep.jsx | 12 +++++++----- website/src/data/components/powerSupplies.json | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/website/src/components/steps/PowerSupplyStep.jsx b/website/src/components/steps/PowerSupplyStep.jsx index be7e5f9..cf8cb6d 100644 --- a/website/src/components/steps/PowerSupplyStep.jsx +++ b/website/src/components/steps/PowerSupplyStep.jsx @@ -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 () => { diff --git a/website/src/data/components/powerSupplies.json b/website/src/data/components/powerSupplies.json index 830c0bf..8f95054 100644 --- a/website/src/data/components/powerSupplies.json +++ b/website/src/data/components/powerSupplies.json @@ -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,