fix bug of empty pubkey

This commit is contained in:
pablof7z 2023-03-16 02:12:46 +01:00
parent e00a3fc19c
commit a3dc27febd
2 changed files with 16 additions and 14 deletions

View file

@ -39,10 +39,10 @@
const input = document.getElementById('message-input');
const message = input.value;
input.value = '';
let extraParams = { tags: [] };
let extraParams = { tags: [], tagPubKeys: [] };
// if this is the rootLevel we want to tag the owner of the site's pubkey
if (!rootNoteId) { extraParams.tagPubKeys = [websiteOwnerPubkey] }
if (!rootNoteId && websiteOwnerPubkey) { extraParams.tagPubKeys = [websiteOwnerPubkey] }
// if we are responding to an event, we want to tag the event and the pubkey
if ($selectedMessage) {

View file

@ -147,9 +147,11 @@ class NstrAdapter {
if (tagPubKeys) {
for (let pubkey of tagPubKeys) {
if (pubkey) {
event.tags.push(['p', pubkey]);
}
}
}
event.id = getEventHash(event)
this.subscribeToEventAndResponses(event.id);