fix: name a new ship's name based on the ship type (#45)

This commit is contained in:
Patric Stout
2023-12-22 13:47:17 +01:00
committed by GitHub
parent 53346708f7
commit 8f3572d76d

View File

@@ -187,13 +187,15 @@ export const ShipSnapshotProvider = (props: ShipSnapshotProps) => {
}, []);
const changeHull = React.useCallback((typeId: number) => {
const hullName = eveData?.typeIDs?.[typeId].name;
setCurrentFit({
"name": "New Ship",
"name": `New ${hullName}`,
"description": "",
"ship_type_id": typeId,
"items": []
})
}, []);
}, [eveData]);
React.useEffect(() => {
setShipSnapshot((oldSnapshot) => ({