fix: return authoritative materials from craft API to prevent client desync
CI / Lint, Build & Test (pull_request) Failing after 1m15s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m16s

Closes #128
This commit is contained in:
2026-03-24 12:15:23 -07:00
committed by Naomi Carrigan
parent b85126c345
commit e808d92909
3 changed files with 14 additions and 10 deletions
+1 -9
View File
@@ -1864,14 +1864,6 @@ export const GameProvider = ({
if (previous?.exploration === undefined) {
return previous;
}
let materials = [ ...previous.exploration.materials ];
for (const request of recipe.requiredMaterials) {
materials = materials.map((mat) => {
return mat.materialId === request.materialId
? { ...mat, quantity: mat.quantity - request.quantity }
: mat;
});
}
return {
...previous,
exploration: {
@@ -1884,7 +1876,7 @@ export const GameProvider = ({
...previous.exploration.craftedRecipeIds,
recipeId,
],
materials: materials,
materials: result.materials,
},
};
});