fix(app): passphrase dialog — remove CSP meta, check crypto.subtle availability

- Remove CSP meta tag from index.html (breaks Vite HMR, should be
  set via HTTP headers in production nginx instead)
- isCryptoEnabled() now checks crypto.subtle is available (undefined
  over HTTP on non-localhost origins)
- Add try/catch + error feedback to passphrase submit flow
- PassphraseDialog accepts error prop, focuses input on visible

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-05 06:58:55 +00:00
co-authored by Claude Opus 4.6
parent 3620b1f4d5
commit c84c0fb424
4 changed files with 36 additions and 22 deletions
@@ -54,8 +54,8 @@
@keydown.enter="handleSubmit"
/>
<p v-if="errorMessage" class="text-xs text-red-400 px-1">
{{ errorMessage }}
<p v-if="errorMessage || props.error" class="text-xs text-red-400 px-1">
{{ errorMessage || props.error }}
</p>
</div>
@@ -86,11 +86,12 @@
</template>
<script setup lang="ts">
import { ref, computed, onMounted, nextTick } from 'vue'
import { ref, computed, watch, nextTick } from 'vue'
const props = defineProps<{
visible: boolean
isCreating: boolean
error?: string
}>()
const emit = defineEmits<{
@@ -124,7 +125,7 @@ function handleSkip() {
emit('skip')
}
onMounted(() => {
nextTick(() => inputRef.value?.focus())
})
watch(() => props.visible, (v) => {
if (v) nextTick(() => inputRef.value?.focus())
}, { immediate: true })
</script>