You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to show previous card on swiping from left to right. As even if I am decrementing the value for index always the next card is shown which is there at the next index of the array.
handleYup(card) {
console.log("yup",card)
//Alert.alert("Card",card.id+"");
this.setState({
cardYup: true
})
}
handleNope(card) {
console.log("nope")
//Alert.alert("Card", card.id + "");
this.setState({
cardNope: true
})
}
cardRemoved(index) {
if(this.state.cardYup){
index=index-2;
this.setState({
cardYup:false
})
}
else if (this.state.cardNope) {
//index = index +1
this.setState({
cardNope: false
})
}
console.log(`The index is ${index}`);
Alert.alert("Index", index+"");
let CARD_REFRESH_LIMIT = 1
if (this.state.cards.length - index <= CARD_REFRESH_LIMIT) {
console.log(`There are only ${this.state.cards.length - index - 1} cards left.`);
if (!this.state.outOfCards) {
//console.log(`Adding ${cards2.length} more cards`)
Alert.alert("No Cards","No morecards present")
this.setState({
outOfCards: true
})
}
}
}
The text was updated successfully, but these errors were encountered:
Is it possible to show previous card on swiping from left to right. As even if I am decrementing the value for index always the next card is shown which is there at the next index of the array.
The text was updated successfully, but these errors were encountered: