diff --git a/src/components/pages/Artifacts.tsx b/src/components/pages/Artifacts.tsx index f23a08b..85f78eb 100644 --- a/src/components/pages/Artifacts.tsx +++ b/src/components/pages/Artifacts.tsx @@ -86,15 +86,10 @@ export default function Artifacts() { }; const getPercent = (affix:IReliquaryAffix)=>{ - try{ - if (affix.PropType.indexOf("PERCENT") !== -1 || affix.PropType.indexOf("CRITICAL") !== -1 || affix.PropType.indexOf("EFFICIENCY") !== -1 || affix.PropType.indexOf("HURT") !== -1) { - return parseFloat(String(affix.PropValue*100)).toPrecision(3) + "%"; - } - return parseInt(String(affix.PropValue)); - }catch (e) { - console.log(e); - return parseInt(String(affix.PropValue)); + if (affix.propType.indexOf("PERCENT") !== -1 || affix.propType.indexOf("CRITICAL") !== -1 || affix.propType.indexOf("EFFICIENCY") !== -1 || affix.propType.indexOf("HURT") !== -1) { + return parseFloat(String(affix.propValue*100)).toPrecision(3) + "%"; } + return parseInt(String(affix.propValue)); }; const handleGeneratedArtifact = () => { @@ -158,7 +153,7 @@ export default function Artifacts() { aria-label="Artifact Main Stats" id="ArtifactMainStats" className="block w-full shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm border-gray-300 rounded-md" options={reliquaryMains} - getOptionLabel={(option) => option.PropType} + getOptionLabel={(option) => option.propType} onChange={handleMainStatChange} renderInput={(params) => } /> @@ -175,9 +170,9 @@ export default function Artifacts() { {reliquaryAffixes.map((affix, index) => { return (
- handleAffixSelected(e,false,0)}/> - - handleAffixSelected(e,true, affix.Id)}/> + handleAffixSelected(e,false,0)}/> + + handleAffixSelected(e,true, affix.id)}/>
); })} diff --git a/src/components/providers/ReliquaryDataProvider.ts b/src/components/providers/ReliquaryDataProvider.ts index 5d8982f..6a0399e 100644 --- a/src/components/providers/ReliquaryDataProvider.ts +++ b/src/components/providers/ReliquaryDataProvider.ts @@ -1,15 +1,15 @@ export interface IReliquaryMain { - Id: number; - PropDepotId: number; - PropType:string; - AffixName:string; + id: number; + propDepotId: number; + propType:string; + affixName:string; } export interface IReliquaryAffix { - Id: number; - DepotId: number; - GroupId: number; - PropType:string; - PropValue:number; + id: number; + depotId: number; + groupId: number; + propType:string; + propValue:number; } export default class ReliquaryDataProvider { private static reliquaryMains:IReliquaryMain[] = []; @@ -25,7 +25,7 @@ export default class ReliquaryDataProvider { let json:IReliquaryMain[] = await data.json(); this.reliquaryMains = []; json.forEach(element => { - if (this.reliquaryMains.filter(x => x.PropType === element.PropType).length === 0) + if (this.reliquaryMains.filter(x => x.propType === element.propType).length === 0) this.reliquaryMains.push(element) }); }