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
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

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