fix(user): referral register links and iPhone login scroll

Use register=true in invite URLs and adjust mobile login layout so the signup button stays reachable on iOS.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-04 12:28:46 +03:30
co-authored by Cursor
parent 5596fc75d0
commit ae01f6c8d6
4 changed files with 43 additions and 20 deletions
+7 -5
View File
@@ -39,10 +39,12 @@ export function renderInviteLinkText(
.replace(/[%٪]\s*نام/gu, userName)
}
function resolveReferralLoginLink(referralId?: string | number | null): string {
function resolveReferralRegisterLink(referralId?: string | number | null): string {
const id = String(referralId ?? '').trim()
if (!id) return ''
const query = `register=true&id=${encodeURIComponent(id)}`
let base = ''
try {
base = String(useSettingsStore().getSettingByKey('app_url') ?? '').trim()
@@ -51,14 +53,14 @@ function resolveReferralLoginLink(referralId?: string | number | null): string {
}
if (base) {
return `${base.replace(/\/+$/, '')}/login?id=${encodeURIComponent(id)}`
return `${base.replace(/\/+$/, '')}/login?${query}`
}
if (typeof window !== 'undefined' && window.location?.origin) {
return `${window.location.origin}/login?id=${encodeURIComponent(id)}`
return `${window.location.origin}/login?${query}`
}
return `/login?id=${encodeURIComponent(id)}`
return `/login?${query}`
}
export function getReferralShareText(options: {
@@ -67,7 +69,7 @@ export function getReferralShareText(options: {
referralId?: string | number | null
}) {
const userName = options.userName ?? ''
const link = resolveReferralLoginLink(options.referralId)
const link = resolveReferralRegisterLink(options.referralId)
return renderInviteLinkText(getInviteLinkTemplate(), { userName, link })
}