浏览代码

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);