mirror of
https://github.com/Stef-00012/Zipline-Android-App.git
synced 2025-05-11 10:25:59 +02:00
21 lines
No EOL
620 B
TypeScript
21 lines
No EOL
620 B
TypeScript
import { useRouter } from "expo-router";
|
|
import { useShareIntentContext } from "expo-share-intent";
|
|
import { useEffect } from "react";
|
|
|
|
export const useShareIntent = (skipRedirect = false) => {
|
|
const router = useRouter()
|
|
const { hasShareIntent, resetShareIntent } = useShareIntentContext();
|
|
|
|
if (skipRedirect) return resetShareIntent;
|
|
|
|
// biome-ignore lint/correctness/useExhaustiveDependencies: .
|
|
useEffect(() => {
|
|
if (hasShareIntent) {
|
|
router.replace({
|
|
pathname: "/shareintent",
|
|
});
|
|
}
|
|
}, [hasShareIntent]);
|
|
|
|
return resetShareIntent;
|
|
} |