From e2f8e7c350d154c69e1121efff1ebd0783cc0c75 Mon Sep 17 00:00:00 2001 From: Hailey Date: Tue, 1 Oct 2024 19:17:29 -0700 Subject: [PATCH] fix type --- src/components/FeedCard.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/FeedCard.tsx b/src/components/FeedCard.tsx index b28f66f839..03a57d0389 100644 --- a/src/components/FeedCard.tsx +++ b/src/components/FeedCard.tsx @@ -1,5 +1,6 @@ import React from 'react' import {GestureResponderEvent, View} from 'react-native' +import {PressableEvent} from 'react-native-gesture-handler/lib/typescript/components/Pressable/PressableProps' import { AppBskyActorDefs, AppBskyFeedDefs, @@ -13,6 +14,7 @@ import {useQueryClient} from '@tanstack/react-query' import {sanitizeHandle} from '#/lib/strings/handles' import {logger} from '#/logger' +import {isWeb} from '#/platform/detection' import {precacheFeedFromGeneratorView} from '#/state/queries/feed' import { useAddSavedFeedsMutation, @@ -254,9 +256,13 @@ function SaveButtonInner({ const isPending = isAddSavedFeedPending || isRemovePending const toggleSave = React.useCallback( - async (e: GestureResponderEvent) => { - e.preventDefault() - e.stopPropagation() + async (e: GestureResponderEvent | PressableEvent) => { + // WEB ONLY - this is okay. See `BottomSheetPressable.web.tsx` + if (isWeb) { + e = e as GestureResponderEvent + e.preventDefault() + e.stopPropagation() + } try { if (savedFeedConfig) {