This commit is contained in:
Haydar Ghasemi 2026-08-23 13:19:43 +03:30
commit a71256e353

View file

@ -67,6 +67,19 @@ function getInviteCode() {
return new URLSearchParams(window.location.search).get("inviteCode");
}
// Picks where to send the user after a successful submission, based on platform.
function getDownloadRedirectUrl() {
const ua = navigator.userAgent || "";
if (/android/i.test(ua)) {
return "https://myket.ir/app/com.adv.winsoo";
}
if (/iphone|ipad|ipod/i.test(ua)) {
return "https://web.winsoo.ir";
}
return "https://winsoo.ir/#Download";
}
const PERSIAN_DIGITS = "۰۱۲۳۴۵۶۷۸۹";
const ARABIC_INDIC_DIGITS = "٠١٢٣٤٥٦٧٨٩";
@ -171,12 +184,17 @@ async function handleSubmit() {
}
setMessage("ثبت شماره با موفقیت انجام شد.", "success");
setButtonLoading(true, "در حال انتقال...");
setTimeout(() => {
window.location.href = getDownloadRedirectUrl();
}, 1200);
return;
} catch (err) {
console.error(err);
setMessage(err.message || "خطا در ارسال اطلاعات. لطفاً دوباره تلاش کنید.", "error");
} finally {
setButtonLoading(false);
}
setButtonLoading(false);
}
submitBtn.addEventListener("click", handleSubmit);