Remove orphaned key import/generate UI
Phase 3 (auto-provision merchant from account keypair) removed the generateKeys / importKeys methods and the dialog data fields, but left the dialog templates and dropdown menu items behind. They referenced importKeyDialog.show and generateKeyDialog.show, which were now undefined — breaking the merchant dashboard with "Cannot read properties of undefined (reading 'show')". Removes: - The Import Key and Generate New Key dialogs from index.html - The corresponding dropdown items from merchant-tab.html - The 'import-key' and 'generate-key' emits from merchant-tab.js - The dangling @import-key / @generate-key listeners in index.html Merchants are auto-provisioned from the account keypair on first GET; key rotation is handled by the migrate-keys feature instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
25023df8bd
commit
3cc798aab2
3 changed files with 1 additions and 107 deletions
|
|
@ -19,9 +19,7 @@ window.app.component('merchant-tab', {
|
||||||
'merchant-deleted',
|
'merchant-deleted',
|
||||||
'toggle-merchant-state',
|
'toggle-merchant-state',
|
||||||
'restart-nostr-connection',
|
'restart-nostr-connection',
|
||||||
'profile-updated',
|
'profile-updated'
|
||||||
'import-key',
|
|
||||||
'generate-key'
|
|
||||||
],
|
],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -64,25 +64,6 @@
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-separator></q-separator>
|
|
||||||
<q-item clickable v-close-popup @click="$emit('import-key')">
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="vpn_key" color="primary"></q-icon>
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section>
|
|
||||||
<q-item-label>Import Existing Key</q-item-label>
|
|
||||||
<q-item-label caption>Use an existing nsec</q-item-label>
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
<q-item clickable v-close-popup @click="$emit('generate-key')">
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="add" color="primary"></q-icon>
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section>
|
|
||||||
<q-item-label>Generate New Key</q-item-label>
|
|
||||||
<q-item-label caption>Create a fresh nsec</q-item-label>
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-btn-dropdown>
|
</q-btn-dropdown>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,6 @@
|
||||||
@merchant-deleted="handleMerchantDeleted"
|
@merchant-deleted="handleMerchantDeleted"
|
||||||
@toggle-merchant-state="toggleMerchantState"
|
@toggle-merchant-state="toggleMerchantState"
|
||||||
@restart-nostr-connection="restartNostrConnection"
|
@restart-nostr-connection="restartNostrConnection"
|
||||||
@import-key="showImportKeysDialog"
|
|
||||||
@generate-key="generateKeys"
|
|
||||||
@profile-updated="getMerchant"
|
@profile-updated="getMerchant"
|
||||||
></merchant-tab>
|
></merchant-tab>
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
|
@ -367,89 +365,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
|
||||||
<q-dialog v-model="importKeyDialog.show" position="top">
|
|
||||||
<q-card class="q-pa-lg q-pt-xl" style="width: 500px">
|
|
||||||
<q-form @submit="importKeys" class="q-gutter-md">
|
|
||||||
<q-input
|
|
||||||
filled
|
|
||||||
dense
|
|
||||||
v-model.trim="importKeyDialog.data.privateKey"
|
|
||||||
label="Private Key (hex or nsec)"
|
|
||||||
></q-input>
|
|
||||||
<div class="row q-mt-lg">
|
|
||||||
<q-btn
|
|
||||||
unelevated
|
|
||||||
color="primary"
|
|
||||||
:disable="!importKeyDialog.data.privateKey"
|
|
||||||
type="submit"
|
|
||||||
>Import</q-btn
|
|
||||||
>
|
|
||||||
<q-btn v-close-popup flat color="grey" class="q-ml-auto"
|
|
||||||
>Cancel</q-btn
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</q-form>
|
|
||||||
</q-card>
|
|
||||||
</q-dialog>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Generate Key Dialog -->
|
|
||||||
<q-dialog v-model="generateKeyDialog.show" position="top">
|
|
||||||
<q-card class="q-pa-lg q-pt-xl" style="width: 500px">
|
|
||||||
<div class="text-h6 q-mb-md">Generate New Key</div>
|
|
||||||
<div class="q-mb-md">
|
|
||||||
<div class="text-subtitle2 q-mb-xs">Public Key (npub)</div>
|
|
||||||
<q-input :model-value="generateKeyDialog.npub" readonly dense outlined>
|
|
||||||
<template v-slot:append>
|
|
||||||
<q-btn
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
icon="content_copy"
|
|
||||||
@click="copyText(generateKeyDialog.npub, 'npub copied!')"
|
|
||||||
></q-btn>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
|
||||||
</div>
|
|
||||||
<div class="q-mb-md">
|
|
||||||
<div class="text-subtitle2 q-mb-xs text-warning">
|
|
||||||
<q-icon name="warning" size="xs"></q-icon>
|
|
||||||
Private Key (nsec)
|
|
||||||
</div>
|
|
||||||
<q-input
|
|
||||||
:model-value="generateKeyDialog.showNsec ? generateKeyDialog.nsec : '••••••••••••••••••••••••••••••••••••••••••••••'"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
>
|
|
||||||
<template v-slot:append>
|
|
||||||
<q-btn
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
:icon="generateKeyDialog.showNsec ? 'visibility_off' : 'visibility'"
|
|
||||||
@click="generateKeyDialog.showNsec = !generateKeyDialog.showNsec"
|
|
||||||
></q-btn>
|
|
||||||
<q-btn
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
icon="content_copy"
|
|
||||||
@click="copyText(generateKeyDialog.nsec, 'nsec copied! Keep it safe!')"
|
|
||||||
></q-btn>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
|
||||||
<div class="text-caption text-negative q-mt-xs">
|
|
||||||
<q-icon name="error" size="xs"></q-icon>
|
|
||||||
Never share your private key!
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row q-mt-lg">
|
|
||||||
<q-btn unelevated color="primary" @click="confirmGenerateKey"
|
|
||||||
>Create Merchant</q-btn
|
|
||||||
>
|
|
||||||
<q-btn v-close-popup flat color="grey" class="q-ml-auto">Cancel</q-btn>
|
|
||||||
</div>
|
|
||||||
</q-card>
|
|
||||||
</q-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock%}{% block scripts %} {{ window_vars(user) }}
|
{% endblock%}{% block scripts %} {{ window_vars(user) }}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue