We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc4407d commit 810543aCopy full SHA for 810543a
1 file changed
src/components/App.js
@@ -154,6 +154,20 @@ function App() {
154
if (fileInfos)
155
return match(fileInfos, forceModel).then((data) => {
156
let simpleApi = simplifyApi(data, fileInfos);
157
+
158
+ // Filter existing computedMatches to remove any references to removed instruments
159
+ setComputedMatches(prev => {
160
+ if (!prev) return prev;
161
+ const validQuestionIndices = new Set(
162
+ fileInfos.flatMap((f, i) =>
163
+ f.questions.map((_, qIdx) => qIdx)
164
+ )
165
+ );
166
+ return prev.filter(match =>
167
+ validQuestionIndices.has(match.qi) && validQuestionIndices.has(match.mqi)
168
169
+ });
170
171
setApiData(simpleApi);
172
});
173
},
0 commit comments