Désactivation de boutons pendant les requêtes
This commit is contained in:
parent
9c6dc97d23
commit
601b337369
@ -179,13 +179,13 @@ export default function ChallengesList() {
|
|||||||
inputMode='numeric'
|
inputMode='numeric'
|
||||||
onChangeText={(text) => setEditChallengeReward(+text)}
|
onChangeText={(text) => setEditChallengeReward(+text)}
|
||||||
error={!editChallengeReward}
|
error={!editChallengeReward}
|
||||||
onEndEditing={sendEditChallenge} />
|
onEndEditing={() => !addChallengeMutation.isPending && editChallengeMutation.isPending && sendEditChallenge()} />
|
||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
<Dialog.Actions>
|
<Dialog.Actions>
|
||||||
<Button onPress={() => setEditChallengeVisible(false)}>Annuler</Button>
|
<Button onPress={() => setEditChallengeVisible(false)}>Annuler</Button>
|
||||||
<Button
|
<Button
|
||||||
onPress={sendEditChallenge}
|
onPress={sendEditChallenge}
|
||||||
disabled={!editChallengeTitle || !editChallengeDescription || !editChallengeReward}>
|
disabled={!editChallengeTitle || !editChallengeDescription || !editChallengeReward || addChallengeMutation.isPending || editChallengeMutation.isPending}>
|
||||||
{editChallengeId ? "Modifier" : "Ajouter"}
|
{editChallengeId ? "Modifier" : "Ajouter"}
|
||||||
</Button>
|
</Button>
|
||||||
</Dialog.Actions>
|
</Dialog.Actions>
|
||||||
@ -199,7 +199,7 @@ export default function ChallengesList() {
|
|||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
<Dialog.Actions>
|
<Dialog.Actions>
|
||||||
<Button onPress={() => setConfirmDeleteVisible(false)}>Annuler</Button>
|
<Button onPress={() => setConfirmDeleteVisible(false)}>Annuler</Button>
|
||||||
<Button onPress={sendDeleteChallenge}>Confirmer</Button>
|
<Button onPress={sendDeleteChallenge} disabled={deleteChallengeMutation.isPending}>Confirmer</Button>
|
||||||
</Dialog.Actions>
|
</Dialog.Actions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</Portal>
|
</Portal>
|
||||||
|
Loading…
Reference in New Issue
Block a user