소스 검색

Fix search bug

Kirk Trombley 3 년 전
부모
커밋
8975cf1053
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      nearest.js

+ 4 - 2
nearest.js

@@ -431,8 +431,10 @@ const renderScored = () => {
   const rgbList = getScoreListRGBNode();
   const appendRGB = getPokemonRenderer(rgbList);
 
+  const clonedData = pokemonColorData.slice();
+
   // extract best CIECAM02 results
-  const bestJAB = pokemonColorData
+  const bestJAB = clonedData
     .sort((a, b) => state.currentScores[a.name].jab - state.currentScores[b.name].jab)
     .slice(0, state.numPoke);
   clearNodeContents(jabList);
@@ -441,7 +443,7 @@ const renderScored = () => {
   ));
 
   // extract best RGB results
-  const bestRGB = pokemonColorData
+  const bestRGB = clonedData
     .sort((a, b) => state.currentScores[a.name].rgb - state.currentScores[b.name].rgb)
     .slice(0, state.numPoke);
   clearNodeContents(rgbList);