mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-13 06:09:42 +02:00
fix custom reactions not being wrapped in :
This commit is contained in:
parent
a22d0d63ec
commit
71b4c4e1eb
@ -28,7 +28,7 @@ export function draftEventReaction(event: NostrEvent, emoji = "+", url?: string)
|
||||
];
|
||||
|
||||
let content = emoji;
|
||||
if (url && !content.startsWith(":") && content.endsWith(":")) content = ":" + content + ":";
|
||||
if (url && !content.startsWith(":") && !content.endsWith(":")) content = ":" + content + ":";
|
||||
|
||||
const draft: DraftNostrEvent = {
|
||||
kind: kinds.Reaction,
|
||||
@ -37,7 +37,7 @@ export function draftEventReaction(event: NostrEvent, emoji = "+", url?: string)
|
||||
created_at: dayjs().unix(),
|
||||
};
|
||||
|
||||
if (url) draft.tags.push(["emoji", emoji, url]);
|
||||
if (url) draft.tags.push(["emoji", emoji.replaceAll(/(^:|:$)/g, ""), url]);
|
||||
|
||||
return draft;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user