feat: tune deeplink fallback page

This commit is contained in:
3252a8
2026-05-23 23:26:10 +03:00
parent 5918a6cc71
commit 46391b10e2
12 changed files with 635 additions and 213 deletions
+7 -1
View File
@@ -33,7 +33,7 @@ export function readExternalAppLaunchTarget(locationRef = null) {
return target;
}
export function buildExternalAppLaunchUrl(value, locationRef = null) {
export function buildExternalAppLaunchUrl(value, locationRef = null, language = "") {
const target = String(value || "").trim();
if (isUnsafeAppUrl(target) || isHttpUrl(target)) return "";
@@ -41,6 +41,12 @@ export function buildExternalAppLaunchUrl(value, locationRef = null) {
if (!ref?.href) return "";
const url = new URL("/open-app", ref.href);
const lang = String(language || "")
.trim()
.toLowerCase();
if (/^[a-z]{2}(?:-[a-z0-9]{2,8})?$/.test(lang)) {
url.searchParams.set("lang", lang);
}
url.hash = new URLSearchParams({ url: target }).toString();
return url.href;
}