Replace NIP-04 messaging with NIP-17 (NIP-44 + NIP-59) #2

Merged
padreug merged 6 commits from refactor/nip17-messaging into main 2026-05-03 15:00:17 +00:00
3 changed files with 1 additions and 107 deletions
Showing only changes of commit 3cc798aab2 - Show all commits

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>
Padreug 2026-05-03 15:51:54 +02:00

View file

@ -19,9 +19,7 @@ window.app.component('merchant-tab', {
'merchant-deleted',
'toggle-merchant-state',
'restart-nostr-connection',
'profile-updated',
'import-key',
'generate-key'
'profile-updated'
],
data: function () {
return {

View file

@ -64,25 +64,6 @@
</q-btn>
</q-item-section>
</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-btn-dropdown>
<q-btn

View file

@ -102,8 +102,6 @@
@merchant-deleted="handleMerchantDeleted"
@toggle-merchant-state="toggleMerchantState"
@restart-nostr-connection="restartNostrConnection"
@import-key="showImportKeysDialog"
@generate-key="generateKeys"
@profile-updated="getMerchant"
></merchant-tab>
</q-tab-panel>
@ -367,89 +365,6 @@
</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>
{% endblock%}{% block scripts %} {{ window_vars(user) }}