diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest index c3bae07..4a60871 100644 --- a/public/manifest.webmanifest +++ b/public/manifest.webmanifest @@ -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", diff --git a/public/sw.js b/public/sw.js index 2a964c1..7632a34 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,4 +1,4 @@ -const CACHE_NAME = 'l484-pwa-v7' +const CACHE_NAME = 'l484-pwa-v8' const APP_SHELL = [ '/', '/manifest.webmanifest', diff --git a/src/App.vue b/src/App.vue index 57e977f..12d6a5c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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) => {
+