Trim Zap comment

We had a bug when trying to parse the json of a comment. It had a \n at the end of it and a browser's json parser couldn't handle it. This should fix
This commit is contained in:
benthecarman
2023-11-11 15:12:24 -06:00
committed by Kieran
parent 6df3459dba
commit 9b5721faa4

View File

@ -178,7 +178,7 @@ export class EventPublisher {
fnExtra?: EventBuilderHook, fnExtra?: EventBuilderHook,
) { ) {
const eb = this.#eb(EventKind.ZapRequest); const eb = this.#eb(EventKind.ZapRequest);
eb.content(msg ?? ""); eb.content(msg?.trim() ?? "");
if (note) { if (note) {
// HACK: remove relay tag, some zap services dont like relay tags // HACK: remove relay tag, some zap services dont like relay tags
eb.tag(unwrap(note.toEventTag()).slice(0, 2)); eb.tag(unwrap(note.toEventTag()).slice(0, 2));