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'
|
||||
onChangeText={(text) => setEditChallengeReward(+text)}
|
||||
error={!editChallengeReward}
|
||||
onEndEditing={sendEditChallenge} />
|
||||
onEndEditing={() => !addChallengeMutation.isPending && editChallengeMutation.isPending && sendEditChallenge()} />
|
||||
</Dialog.Content>
|
||||
<Dialog.Actions>
|
||||
<Button onPress={() => setEditChallengeVisible(false)}>Annuler</Button>
|
||||
<Button
|
||||
onPress={sendEditChallenge}
|
||||
disabled={!editChallengeTitle || !editChallengeDescription || !editChallengeReward}>
|
||||
disabled={!editChallengeTitle || !editChallengeDescription || !editChallengeReward || addChallengeMutation.isPending || editChallengeMutation.isPending}>
|
||||
{editChallengeId ? "Modifier" : "Ajouter"}
|
||||
</Button>
|
||||
</Dialog.Actions>
|
||||
@ -199,7 +199,7 @@ export default function ChallengesList() {
|
||||
</Dialog.Content>
|
||||
<Dialog.Actions>
|
||||
<Button onPress={() => setConfirmDeleteVisible(false)}>Annuler</Button>
|
||||
<Button onPress={sendDeleteChallenge}>Confirmer</Button>
|
||||
<Button onPress={sendDeleteChallenge} disabled={deleteChallengeMutation.isPending}>Confirmer</Button>
|
||||
</Dialog.Actions>
|
||||
</Dialog>
|
||||
</Portal>
|
||||
|
Loading…
Reference in New Issue
Block a user