fix(demo): companion app skips the demo intro — lands straight on /login
When the demo build runs inside the Android companion WebView (window.ArchipelagoNative bridge, detected via the existing isCompanionApp()), all four IS_DEMO intro branch sites now skip the typing splash and /onboarding/intro and route directly to /login, as if the intro was already seen: - App.vue root-boot replay request (companion never requests the splash) - App.vue post-splash demo routing - RootRedirect proceedToApp() and the server-up onMounted demo branch The skip paths write nothing to localStorage/sessionStorage (RootRedirect skips even its boot log() there), so the browser/PWA demo intro — which replays on every fresh root boot — is byte-identical to before, and non-demo builds short-circuit on IS_DEMO before isCompanionApp() runs. Adds a small isCompanionApp() bridge-detection unit test (700 tests green). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
b80e7c3487
commit
d54517cf0b
@@ -17,6 +17,7 @@ import { ref, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { isOnboardingComplete } from '@/composables/useOnboarding'
|
||||
import { IS_DEMO } from '@/composables/useDemoIntro'
|
||||
import { isCompanionApp } from '@/utils/openExternal'
|
||||
import BootScreen from '@/components/BootScreen.vue'
|
||||
|
||||
const router = useRouter()
|
||||
@@ -80,6 +81,13 @@ async function checkOnboarded(): Promise<boolean> {
|
||||
|
||||
async function proceedToApp() {
|
||||
if (IS_DEMO) {
|
||||
// Companion in-app demo skips the intro (acts as intro-already-seen) and
|
||||
// lands on /login; browser demo unaffected. No log() here — it writes
|
||||
// sessionStorage, and the skip path must write nothing.
|
||||
if (isCompanionApp()) {
|
||||
router.replace('/login').catch(() => {})
|
||||
return
|
||||
}
|
||||
demoRoute()
|
||||
return
|
||||
}
|
||||
@@ -147,6 +155,12 @@ onMounted(async () => {
|
||||
if (isUp) {
|
||||
// Demo: per-day intro gate instead of server-side onboarding state.
|
||||
if (IS_DEMO) {
|
||||
// Companion in-app demo skips the intro; browser demo unaffected.
|
||||
// No log() — the skip path must write nothing to storage.
|
||||
if (isCompanionApp()) {
|
||||
router.replace('/login').catch(() => {})
|
||||
return
|
||||
}
|
||||
demoRoute()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user