Added check for when card is swiped via ref function #106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
We came across a use case in our project where we had to track whether the card was swiped by swiping or via a button that called the respective ref function that would swipe the card by itself. I've attached a video to show this action happening.
In the current implementation there was no way of knowing whether the card was swiped by the user themself or via the ref function, after the action takes place and we get a response from the back end. The basic flow is:
Swipe(button or gesture) => api call sent to back end => response received from back end => analytics query sent which includes an id returned in the response from the back end.
For that reason i added a third return value (isViaRef) to all swipe functions which returns true when any of the ref functions are called and false otherwise.
Video demonstration:
Screen.Recording.Swiper-.iPhone.14.Pro.mp4