From b6468ebf3c86bf0bdacb2fff2e46b293244c2d73 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sat, 18 Jul 2026 11:54:12 +0100 Subject: [PATCH] fix(android): let Vue re-render before auto-login submits the password Dispatch the Enter keydown two frames after the input event so the login button is enabled when it arrives. Keeps auto-login working against nodes running older web builds where controller-nav's Enter-in-input pattern would otherwise click Replay Intro (see the matching web-ui fix). Co-Authored-By: Claude Fable 5 --- .../com/archipelago/app/ui/screens/WebViewScreen.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Android/app/src/main/java/com/archipelago/app/ui/screens/WebViewScreen.kt b/Android/app/src/main/java/com/archipelago/app/ui/screens/WebViewScreen.kt index 3bd16fff..f38a4ec9 100644 --- a/Android/app/src/main/java/com/archipelago/app/ui/screens/WebViewScreen.kt +++ b/Android/app/src/main/java/com/archipelago/app/ui/screens/WebViewScreen.kt @@ -741,7 +741,16 @@ private fun buildAutoLoginScript(password: String): String { var setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set; setter.call(el, pw); el.dispatchEvent(new Event('input', { bubbles: true })); - el.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true })); + // Let Vue re-render before submitting: a synchronous Enter arrives + // while the login button is still disabled, and the web UI's + // controller-nav "Enter in input clicks the next enabled button" + // pattern then hits Replay Intro instead — restarting the intro + // cinematic on every connect (two frames = value flush + render). + requestAnimationFrame(function () { + requestAnimationFrame(function () { + el.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true })); + }); + }); }, 1500); })(); """.trimIndent()