Skip to content

Commit

Permalink
fix: modified variable not initialised
Browse files Browse the repository at this point in the history
  • Loading branch information
AngyDev committed Dec 14, 2024
1 parent 4bed26f commit 8b17c08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/src/components/Import/Import.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ export default function Import() {
// If an object is saved, the position of the imported object is set to the center of the saved object
let firstPosition = Object.keys(positionVector).length !== 0 ? positionVector : null;

let modified = isModified;
for (var i = 0; i < files.length; i++) {
if (files[i].name.split(".").pop() === "stl") {
let modified = modified ? !modified : isModified;

const contents = await loadFile(files[i]);
const mesh = createMeshFromFile(files[i].name, contents);

Expand All @@ -56,7 +55,8 @@ export default function Import() {
}

addPositionToMesh(mesh, position ? position : firstPosition);
dispatch(setSceneModified(!modified));
modified = !modified;
dispatch(setSceneModified(modified));
} else {
setError(true);
}
Expand Down

0 comments on commit 8b17c08

Please sign in to comment.