fix: backup screen — autofocus passphrase, rename button, focus Continue after download
- Passphrase input autofocused on mount - "Download Backup" renamed to "Backup to Continue" - Continue button autofocused after successful backup download Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ff85754aa2
commit
b773ba610f
@ -30,6 +30,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
|
ref="passphraseInput"
|
||||||
v-model="passphrase"
|
v-model="passphrase"
|
||||||
type="password"
|
type="password"
|
||||||
placeholder="Enter a strong passphrase"
|
placeholder="Enter a strong passphrase"
|
||||||
@ -48,7 +49,7 @@
|
|||||||
:disabled="!passphrase || isDownloading"
|
:disabled="!passphrase || isDownloading"
|
||||||
class="path-action-button path-action-button--continue w-full"
|
class="path-action-button path-action-button--continue w-full"
|
||||||
>
|
>
|
||||||
<span v-if="!isDownloading && !downloaded">Download Backup</span>
|
<span v-if="!isDownloading && !downloaded">Backup to Continue</span>
|
||||||
<span v-else-if="isDownloading" class="flex items-center justify-center gap-2">
|
<span v-else-if="isDownloading" class="flex items-center justify-center gap-2">
|
||||||
<svg class="animate-spin h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
<svg class="animate-spin h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||||
@ -76,6 +77,7 @@
|
|||||||
<!-- Action Buttons -->
|
<!-- Action Buttons -->
|
||||||
<div class="flex justify-center max-w-[600px] mx-auto flex-shrink-0 px-3 sm:px-4 pb-4 sm:pb-6">
|
<div class="flex justify-center max-w-[600px] mx-auto flex-shrink-0 px-3 sm:px-4 pb-4 sm:pb-6">
|
||||||
<button
|
<button
|
||||||
|
ref="continueButton"
|
||||||
@click="proceed"
|
@click="proceed"
|
||||||
:disabled="!downloaded"
|
:disabled="!downloaded"
|
||||||
class="path-action-button path-action-button--continue disabled:opacity-50"
|
class="path-action-button path-action-button--continue disabled:opacity-50"
|
||||||
@ -88,12 +90,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { rpcClient } from '@/api/rpc-client'
|
import { rpcClient } from '@/api/rpc-client'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const passphraseInput = ref<HTMLInputElement | null>(null)
|
||||||
|
const continueButton = ref<HTMLButtonElement | null>(null)
|
||||||
const passphrase = ref('')
|
const passphrase = ref('')
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
passphraseInput.value?.focus({ preventScroll: true })
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
const isDownloading = ref(false)
|
const isDownloading = ref(false)
|
||||||
const downloaded = ref(false)
|
const downloaded = ref(false)
|
||||||
const errorMessage = ref('')
|
const errorMessage = ref('')
|
||||||
@ -127,6 +137,10 @@ async function downloadBackup() {
|
|||||||
|
|
||||||
downloaded.value = true
|
downloaded.value = true
|
||||||
localStorage.setItem('neode_backup_created', '1')
|
localStorage.setItem('neode_backup_created', '1')
|
||||||
|
// Focus Continue button after backup completes
|
||||||
|
setTimeout(() => {
|
||||||
|
continueButton.value?.focus({ preventScroll: true })
|
||||||
|
}, 100)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const msg = err instanceof Error ? err.message : String(err)
|
const msg = err instanceof Error ? err.message : String(err)
|
||||||
if (/502|503|504|timeout|fetch|network|Failed to fetch/i.test(msg)) {
|
if (/502|503|504|timeout|fetch|network|Failed to fetch/i.test(msg)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user