Skip to content

Commit 8b17c08

Browse files
committed
fix: modified variable not initialised
1 parent 4bed26f commit 8b17c08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client/src/components/Import/Import.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ export default function Import() {
4141
// If an object is saved, the position of the imported object is set to the center of the saved object
4242
let firstPosition = Object.keys(positionVector).length !== 0 ? positionVector : null;
4343

44+
let modified = isModified;
4445
for (var i = 0; i < files.length; i++) {
4546
if (files[i].name.split(".").pop() === "stl") {
46-
let modified = modified ? !modified : isModified;
47-
4847
const contents = await loadFile(files[i]);
4948
const mesh = createMeshFromFile(files[i].name, contents);
5049

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

5857
addPositionToMesh(mesh, position ? position : firstPosition);
59-
dispatch(setSceneModified(!modified));
58+
modified = !modified;
59+
dispatch(setSceneModified(modified));
6060
} else {
6161
setError(true);
6262
}

0 commit comments

Comments
 (0)