feat(core): open desktop directly in subscription landing page (#6661)

This commit is contained in:
CatsJuice
2024-04-22 14:21:58 +00:00
parent 71a5be5385
commit 6ec97b27c4
6 changed files with 50 additions and 7 deletions

View File

@@ -155,6 +155,14 @@ export function useNavigateHelper() {
[navigate]
);
const openInApp = useCallback(
(schema: string, path: string) => {
const encodedUrl = encodeURIComponent(`${schema}://${path}`);
return navigate(`/open-app/url?schema=${schema}&url=${encodedUrl}`);
},
[navigate]
);
return useMemo(
() => ({
jumpToPage,
@@ -169,6 +177,7 @@ export function useNavigateHelper() {
jumpToCollections,
jumpToTags,
jumpToTag,
openInApp,
}),
[
jumpToPage,
@@ -183,6 +192,7 @@ export function useNavigateHelper() {
jumpToCollections,
jumpToTags,
jumpToTag,
openInApp,
]
);
}