Reset confirmation states when re-evaluating sort items. Also button refresh occurs at the end of errors and returns

main
sigonasr2 2 years ago
parent 5649fd90f3
commit 53406cd6d6
  1. 12
      src/App.js

@ -120,6 +120,11 @@ function SorterApp(){
function submitForm(){
if (item1.length>0&&item2.length>0&&item3.length>0&&item4.length>0&&item5.length>0&&
item1_2.length>0&&item2_2.length>0&&item3_2.length>0&&item4_2.length>0&&item5_2.length>0){
setResult1(NONE)
setResult2(NONE)
setResult3(NONE)
setResult4(NONE)
setResult5(NONE)
setChecking(true);
for (let i of [
@ -164,24 +169,27 @@ function SorterApp(){
itemData2={...results}
if (itemData1.ItemSortCategory.ID<itemData2.ItemSortCategory.ID){
i.resultFunc(SUCCESS)
setChecking(false)
return
} else
if (itemData1.ItemSortCategory.ID==itemData2.ItemSortCategory.ID&&
itemData1.ItemUICategory.ID<itemData2.ItemUICategory.ID){
i.resultFunc(SUCCESS)
setChecking(false)
return
} else
if (itemData1.ItemSortCategory.ID==itemData2.ItemSortCategory.ID&&
itemData1.ItemUICategory.ID==itemData2.ItemUICategory.ID&&
itemData1.ID<itemData2.ID){
i.resultFunc(SUCCESS)
setChecking(false)
return
} else {
i.resultFunc(REJECTED)
setChecking(false)
}
})
.catch((err)=>{console.log(err);})
.finally(()=>{setChecking(false)})
.catch((err)=>{console.log(err);setChecking(false)})
}
//axios.get(encodeURI("https://xivapi.com/search?string="+i))
}

Loading…
Cancel
Save