Replace missing install prompt with app handoff

This commit is contained in:
Dorian
2026-05-15 17:02:15 -05:00
parent d6f621236f
commit 886066ab5d
3 changed files with 23 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
"name": "L484 Membership",
"short_name": "L484",
"description": "Private L484 membership card and agreement portal.",
"start_url": "/",
"start_url": "/?signup=continue",
"scope": "/",
"id": "/",
"display": "standalone",

View File

@@ -1,4 +1,4 @@
const CACHE_NAME = 'l484-pwa-v7'
const CACHE_NAME = 'l484-pwa-v8'
const APP_SHELL = [
'/',
'/manifest.webmanifest',

View File

@@ -816,14 +816,20 @@ const handlePwaInstallPrimary = async () => {
return
}
if (installPlatform.value === 'desktop') {
formError.value = 'The browser install prompt is not available yet. Refresh once, then press Install app again.'
if (installPlatform.value === 'desktop' || installPlatform.value === 'android') {
signupStep.value = 2
saveSignupDraft()
pwaInstallMessage.value = 'L484 may already be installed on this device. Open the installed app to finish signup.'
return
}
formError.value = installPlatform.value === 'ios'
? 'Install L484 from Safari using Share, Add to Home Screen, then reopen it from the app icon.'
: 'Install L484 from your browser menu or address bar, then reopen the installed app to continue.'
pwaInstallMessage.value = 'Install L484 from Safari using Share, Add to Home Screen, then reopen it from the app icon.'
}
const openInstalledApp = () => {
signupStep.value = 2
saveSignupDraft()
window.location.href = '/?signup=continue'
}
const startSignup = async () => {
@@ -2123,6 +2129,13 @@ onMounted(async () => {
} else if (window.location.pathname === '/auth/nostr-callback') {
resumePendingRemoteSignin()
}
if (new URLSearchParams(window.location.search).get('signup') === 'continue') {
window.history.replaceState({}, '', '/')
currentPath.value = '/'
signupStep.value = currentMember.value ? 5 : 2
saveSignupDraft()
openSignup()
}
window.addEventListener('popstate', () => {
currentPath.value = window.location.pathname
})
@@ -3493,6 +3506,9 @@ watch(mobileMenuOpen, (open) => {
<p v-if="pwaInstallMessage" class="validation-message rounded border border-white/15 bg-white/5 p-3 text-sm text-white/70">
Open the L484 app icon on your homescreen. Signup will continue at name entry.
</p>
<button v-if="pwaInstallMessage" class="primary-action w-full" type="button" @click="openInstalledApp">
Open app
</button>
</div>
<div v-if="signupStep === 2" class="space-y-4">