Skip to content

Commit 90fa6f8

Browse files
committed
only search current project
1 parent 2f7425c commit 90fa6f8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/reactComponents/Menu.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,24 +152,24 @@ export function Component(props: MenuProps) {
152152
const moduleFromPath = (key : string) : (commonStorage.Module | null) =>{
153153
let foundModule = null;
154154

155-
modules.forEach((module) => {
156-
if (key == module.modulePath){
157-
foundModule = module;
155+
if(project){
156+
if (key == project.modulePath){
157+
foundModule = project;
158158
return foundModule;
159159
}
160-
module.mechanisms.forEach((mechanism) => {
160+
project.mechanisms.forEach((mechanism) => {
161161
if(key == mechanism.modulePath){
162162
foundModule = mechanism;
163163
return foundModule;
164164
}
165165
});
166-
module.opModes.forEach((opmode) => {
166+
project.opModes.forEach((opmode) => {
167167
if(key == opmode.modulePath){
168168
foundModule = opmode;
169169
return foundModule;
170170
}
171171
});
172-
});
172+
}
173173

174174
return foundModule;
175175
};

0 commit comments

Comments
 (0)