Skip to content

Commit

Permalink
fix: code review suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Ole <[email protected]>
Co-authored-by: Mounir Dhahri <[email protected]>
  • Loading branch information
3 people committed Nov 25, 2024
1 parent c028406 commit aeb8d74
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/app/utils/hooks/useIsDeepLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Linking } from "react-native"
*
* This can be used to avoid rendering content in previous screens in react-navigation history
*
* @returns {isDeepLink: boolean | null} isDeepLink is true if the user came from a deep link
* @returns {isDeepLink: boolean | null}` isDeepLink` is true if the user came from a deep link. Initially, it is set to `null` while retrieving the deep link URL asynchronously and will be set to `false` if retrieving the `URL` fails.
*/
export const useIsDeepLink = () => {
const [isDeepLink, setIsDeepLink] = useState<boolean | null>(null)
Expand Down Expand Up @@ -37,11 +37,7 @@ export const useIsDeepLink = () => {
const isHomeLink = result.type === "match" && result.module === "Home"
const shouldTreatAsDeepLink = !isHomeLink && !isExternalUrl

if (shouldTreatAsDeepLink) {
setIsDeepLink(true)
} else {
setIsDeepLink(false)
}
setIsDeepLink(shouldTreatAsDeepLink)
})
.catch((error) => {
console.error("Error getting initial URL", error)
Expand Down

0 comments on commit aeb8d74

Please sign in to comment.