@@ -150,15 +150,16 @@ export const InfiniteDiscovery: React.FC<InfiniteDiscoveryProps> = ({
150
150
/**
151
151
* The callback for when a swiped card is brought back.
152
152
* @param key The key of the card that was brought back.
153
+ * @param wasSwiped True if the card was swiped back, false if it was tapped back.
153
154
*/
154
- const handleRewind = ( key : Key ) => {
155
+ const handleRewind = ( key : Key , wasSwiped = true ) => {
155
156
const artwork = artworks . find ( ( artwork ) => artwork . internalID === key )
156
157
157
158
if ( ! artwork ) {
158
159
return
159
160
}
160
161
161
- trackEvent ( tracks . tappedRewind ( artwork . internalID , artwork . slug ) )
162
+ trackEvent ( tracks . tappedRewind ( artwork . internalID , artwork . slug , wasSwiped ? "swipe" : "tap" ) )
162
163
163
164
setTopArtworkId ( artwork . internalID )
164
165
}
@@ -343,12 +344,13 @@ const tracks = {
343
344
action : ActionType . tappedClose ,
344
345
context_module : ContextModule . infiniteDiscovery ,
345
346
} ) ,
346
- tappedRewind : ( artworkId : string , artworkSlug : string ) => ( {
347
+ tappedRewind : ( artworkId : string , artworkSlug : string , mode : "swipe" | "tap" ) => ( {
347
348
action : ActionType . tappedRewind ,
348
349
context_module : ContextModule . infiniteDiscovery ,
349
350
context_screen_owner_id : artworkId ,
350
351
context_screen_owner_slug : artworkSlug ,
351
352
context_screen_owner_type : OwnerType . infiniteDiscoveryArtwork ,
353
+ mode,
352
354
} ) ,
353
355
tappedSummary : ( ) => ( {
354
356
action : ActionType . tappedToast ,
0 commit comments