diff --git a/src/components/viewer/Viewer.common.ts b/src/components/viewer/Viewer.common.ts index 7944072..60b106b 100644 --- a/src/components/viewer/Viewer.common.ts +++ b/src/components/viewer/Viewer.common.ts @@ -2,9 +2,8 @@ import { captureException } from "@sentry/react-native"; import { Dimensions, Share } from "react-native"; import { conAbbr } from "../../configuration"; -import { debounceOnAndroid } from "../../util/debounceOnAndroid"; -export const shareImage = debounceOnAndroid((url: string, title: string) => +export const shareImage = (url: string, title: string) => Share.share( { title, @@ -12,8 +11,7 @@ export const shareImage = debounceOnAndroid((url: string, title: string) => message: `Check out ${title} on ${conAbbr}!\n${url}`, }, {}, - ).catch(captureException), -); + ).catch(captureException); export const minZoomFor = (width: number, height: number, padding: number) => { if (width <= 0 || height <= 0) return 1; diff --git a/src/routes/dealers/Dealers.common.ts b/src/routes/dealers/Dealers.common.ts index 4e66a43..d5f406e 100644 --- a/src/routes/dealers/Dealers.common.ts +++ b/src/routes/dealers/Dealers.common.ts @@ -11,7 +11,6 @@ import { appBase, conAbbr } from "../../configuration"; import { useAppSelector } from "../../store"; import { selectDealerCategoryMapper } from "../../store/eurofurence/selectors/dealers"; import { DealerDetails } from "../../store/eurofurence/types"; -import { debounceOnAndroid } from "../../util/debounceOnAndroid"; /** * Compares category, checks if the categories are adult labeled. @@ -179,7 +178,7 @@ export const useDealerAlphabeticalGroups = (t: TFunction, now: Moment, results: }, [t, now, results, all]); }; -export const shareDealer = debounceOnAndroid((dealer: DealerDetails) => +export const shareDealer = (dealer: DealerDetails) => Share.share( { title: dealer.DisplayNameOrAttendeeNickname, @@ -187,5 +186,4 @@ export const shareDealer = debounceOnAndroid((dealer: DealerDetails) => message: `Check out ${dealer.DisplayNameOrAttendeeNickname} on ${conAbbr}!\n${appBase}/Web/Dealers/${dealer.Id}`, }, {}, - ).catch(captureException), -); + ).catch(captureException); diff --git a/src/routes/events/Events.common.ts b/src/routes/events/Events.common.ts index 1eabca3..cf91d7e 100644 --- a/src/routes/events/Events.common.ts +++ b/src/routes/events/Events.common.ts @@ -9,7 +9,6 @@ import { EventDetailsInstance, eventInstanceForAny, eventInstanceForNotPassed, e import { eventSectionForDate, eventSectionForHidden, eventSectionForPartOfDay, eventSectionForPassed, EventSectionProps } from "../../components/events/EventSection"; import { appBase, conAbbr } from "../../configuration"; import { EventDetails } from "../../store/eurofurence/types"; -import { debounceOnAndroid } from "../../util/debounceOnAndroid"; /** Returns a list of event instances according to conversion rules. @@ -210,7 +209,7 @@ export const useEventOtherGroups = (t: TFunction, now: Moment, zone: string, all }, [t, now, zone, all]); }; -export const shareEvent = debounceOnAndroid((event: EventDetails) => +export const shareEvent = (event: EventDetails) => Share.share( { title: event.Title, @@ -218,5 +217,4 @@ export const shareEvent = debounceOnAndroid((event: EventDetails) => message: `Check out ${event.Title} on ${conAbbr}!\n${appBase}/Web/Events/${event.Id}`, }, {}, - ).catch(captureException), -); + ).catch(captureException); diff --git a/src/util/debounceOnAndroid.ts b/src/util/debounceOnAndroid.ts deleted file mode 100644 index e54be52..0000000 --- a/src/util/debounceOnAndroid.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { debounce } from "lodash"; -import { Platform } from "react-native"; - -/** - * Debounces the function only on Android. - * @param func The function to debounce - * @param wait The wait time if debouncing. - */ -export const debounceOnAndroid = any>(func: T, wait: number = 1000) => { - if (Platform.OS === "ios") return func; - else return debounce(func, wait, { leading: false, trailing: false }); -};