mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-19 12:00:32 +02:00
fix custom reactions not being wrapped in :
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user