Update validity checking
This commit is contained in:
parent
feba0271a8
commit
3983d5411c
1 changed files with 5 additions and 4 deletions
|
|
@ -101,7 +101,7 @@ const WeaponModal = (props: Props) => {
|
||||||
setSecondaryAxValue(secondaryAxValue)
|
setSecondaryAxValue(secondaryAxValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
function receiveAxValidity(isValid: boolean) {
|
function receiveValidity(isValid: boolean) {
|
||||||
setFormValid(isValid)
|
setFormValid(isValid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -153,7 +153,6 @@ const WeaponModal = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function processResult(response: AxiosResponse) {
|
function processResult(response: AxiosResponse) {
|
||||||
console.log(response)
|
|
||||||
const gridWeapon: GridWeapon = response.data
|
const gridWeapon: GridWeapon = response.data
|
||||||
|
|
||||||
if (gridWeapon.mainhand) appState.grid.weapons.mainWeapon = gridWeapon
|
if (gridWeapon.mainhand) appState.grid.weapons.mainWeapon = gridWeapon
|
||||||
|
|
@ -231,7 +230,7 @@ const WeaponModal = (props: Props) => {
|
||||||
<AXSelect
|
<AXSelect
|
||||||
axType={props.gridWeapon.object.ax}
|
axType={props.gridWeapon.object.ax}
|
||||||
currentSkills={props.gridWeapon.ax}
|
currentSkills={props.gridWeapon.ax}
|
||||||
sendValidity={receiveAxValidity}
|
sendValidity={receiveValidity}
|
||||||
sendValues={receiveAxValues}
|
sendValues={receiveAxValues}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -246,6 +245,7 @@ const WeaponModal = (props: Props) => {
|
||||||
object="weapon"
|
object="weapon"
|
||||||
awakeningType={props.gridWeapon.awakening?.type}
|
awakeningType={props.gridWeapon.awakening?.type}
|
||||||
awakeningLevel={props.gridWeapon.awakening?.level}
|
awakeningLevel={props.gridWeapon.awakening?.level}
|
||||||
|
sendValidity={receiveValidity}
|
||||||
sendValues={receiveAwakeningValues}
|
sendValues={receiveAwakeningValues}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -289,9 +289,10 @@ const WeaponModal = (props: Props) => {
|
||||||
{props.gridWeapon.object.ax > 0 ? axSelect() : ''}
|
{props.gridWeapon.object.ax > 0 ? axSelect() : ''}
|
||||||
{props.gridWeapon.awakening ? awakeningSelect() : ''}
|
{props.gridWeapon.awakening ? awakeningSelect() : ''}
|
||||||
<Button
|
<Button
|
||||||
|
className={!formValid ? 'Disabled' : ''}
|
||||||
contained={true}
|
contained={true}
|
||||||
onClick={updateWeapon}
|
onClick={updateWeapon}
|
||||||
disabled={props.gridWeapon.object.ax > 0 && !formValid}
|
disabled={!formValid}
|
||||||
text={t('modals.weapon.buttons.confirm')}
|
text={t('modals.weapon.buttons.confirm')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue