mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-20 13:01:07 +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;
|
let content = emoji;
|
||||||
if (url && !content.startsWith(":") && content.endsWith(":")) content = ":" + content + ":";
|
if (url && !content.startsWith(":") && !content.endsWith(":")) content = ":" + content + ":";
|
||||||
|
|
||||||
const draft: DraftNostrEvent = {
|
const draft: DraftNostrEvent = {
|
||||||
kind: kinds.Reaction,
|
kind: kinds.Reaction,
|
||||||
@@ -37,7 +37,7 @@ export function draftEventReaction(event: NostrEvent, emoji = "+", url?: string)
|
|||||||
created_at: dayjs().unix(),
|
created_at: dayjs().unix(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (url) draft.tags.push(["emoji", emoji, url]);
|
if (url) draft.tags.push(["emoji", emoji.replaceAll(/(^:|:$)/g, ""), url]);
|
||||||
|
|
||||||
return draft;
|
return draft;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user