From 32ed8d75acead1bb62b0354eb1635b7d7af2e573 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Thu, 29 Jul 2021 05:52:18 +0000 Subject: [PATCH] Remove all warnings so app builds on production. --- src/App.js | 34 ++++++++++++++-------------------- src/TestHeader.js | 10 +++++----- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/App.js b/src/App.js index ec12d13..692604a 100644 --- a/src/App.js +++ b/src/App.js @@ -23,9 +23,9 @@ const parse = require('csv-parse/lib/sync') const BACKEND_URL = process.env.REACT_APP_GITPOD_WORKSPACE_URL||process.env.REACT_APP_BACKEND_URL||'https://projectdivar.com:4504'; //You can specify a .env file locally with REACT_APP_BACKEND_URL defining a URL to retrieve data from. -const MELEE_DMG = 0 +/*const MELEE_DMG = 0 const RANGE_DMG = 1 -const TECH_DMG = 2 +const TECH_DMG = 2 //NOT USED YET*/ function Col(p) { return
@@ -431,7 +431,6 @@ function TableEditor(p) { const [dependencies,setDependencies] = useState([]) const [importAllowed,setImportAllowed] = useState(false) const [fileData,setFileData] = useState(undefined) - const [debugMessage,setDebugMessage] = useState("") function SubmitBoxes() { axios.post(BACKEND_URL+p.path,submitVals) @@ -461,7 +460,7 @@ function TableEditor(p) { .then(()=>{ setUpdate(true) }) - },[fileData]) + },[fileData,p.path]) useEffect(()=>{ for (var col of fields) { @@ -513,7 +512,6 @@ function TableEditor(p) { } reader.readAsText(f.target.files[0]) }} style={{opacity:0}} id="uploads" type="file" accept=".txt,.csv"/>} - {JSON.stringify(debugMessage)} @@ -649,7 +647,7 @@ function EditStatBox(p) { function DamageCalculator(p) { const [augmentData,setAugmentData] = useState({}) - const [update,setUpdate] = useState(false) + //const [update,setUpdate] = useState(false) useEffect(()=>{ axios.get(BACKEND_URL+"/augment") @@ -658,7 +656,7 @@ function DamageCalculator(p) { data.data.rows.forEach((entry)=>{augmentData[entry.id]=entry}) setAugmentData(augmentData) }) - },[update]) + },[]) const character = { weapon:{ @@ -677,22 +675,18 @@ function DamageCalculator(p) { useEffect(()=>{ if (Object.keys(augmentData).length>0) { - ParseAllAugments(character) - } - },[augmentData]) - - function ParseAllAugments(character) { - var searchFields = [{field:"variance",variable:0},{field:"mel_dmg",variable:0}] - for (var equip of [character.weapon,character.armor1,character.armor2,character.armor3]) { - for (var field of searchFields) { - for (var i=0;i