fix bug of empty pubkey
This commit is contained in:
parent
e00a3fc19c
commit
a3dc27febd
2 changed files with 16 additions and 14 deletions
|
|
@ -39,10 +39,10 @@
|
||||||
const input = document.getElementById('message-input');
|
const input = document.getElementById('message-input');
|
||||||
const message = input.value;
|
const message = input.value;
|
||||||
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 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 we are responding to an event, we want to tag the event and the pubkey
|
||||||
if ($selectedMessage) {
|
if ($selectedMessage) {
|
||||||
|
|
|
||||||
|
|
@ -147,9 +147,11 @@ class NstrAdapter {
|
||||||
|
|
||||||
if (tagPubKeys) {
|
if (tagPubKeys) {
|
||||||
for (let pubkey of tagPubKeys) {
|
for (let pubkey of tagPubKeys) {
|
||||||
|
if (pubkey) {
|
||||||
event.tags.push(['p', pubkey]);
|
event.tags.push(['p', pubkey]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event.id = getEventHash(event)
|
event.id = getEventHash(event)
|
||||||
this.subscribeToEventAndResponses(event.id);
|
this.subscribeToEventAndResponses(event.id);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue