@@ -35,10 +35,7 @@ import MakeMeJSON from "./MakeMeJSON.js";
3535import "react-toastify/dist/ReactToastify.css" ;
3636import YouTube from "react-youtube" ;
3737import "../css/youtube.css" ;
38- import { useHistory } from "react-router-dom" ;
39-
4038function App ( ) {
41- const history = useHistory ( ) ;
4239 const [ fullscreen , setFullscreen ] = useState ( false ) ;
4340 const [ existingInstruments , setExistingInstruments ] = useState ( [ ] ) ;
4441 const [ apiData , setApiData ] = useState ( { } ) ;
@@ -154,20 +151,20 @@ function App() {
154151 if ( fileInfos )
155152 return match ( fileInfos , forceModel ) . then ( ( data ) => {
156153 let simpleApi = simplifyApi ( data , fileInfos ) ;
157-
154+
158155 // Filter existing computedMatches to remove any references to removed instruments
159- setComputedMatches ( prev => {
156+ setComputedMatches ( ( prev ) => {
160157 if ( ! prev ) return prev ;
161158 const validQuestionIndices = new Set (
162- fileInfos . flatMap ( ( f , i ) =>
163- f . questions . map ( ( _ , qIdx ) => qIdx )
164- )
159+ fileInfos . flatMap ( ( f , i ) => f . questions . map ( ( _ , qIdx ) => qIdx ) )
165160 ) ;
166- return prev . filter ( match =>
167- validQuestionIndices . has ( match . qi ) && validQuestionIndices . has ( match . mqi )
161+ return prev . filter (
162+ ( match ) =>
163+ validQuestionIndices . has ( match . qi ) &&
164+ validQuestionIndices . has ( match . mqi )
168165 ) ;
169166 } ) ;
170-
167+
171168 setApiData ( simpleApi ) ;
172169 } ) ;
173170 } ,
0 commit comments