From c7348329523668e81825d669ed4a1008cd468fc4 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 31 Dec 2022 16:40:12 -0500 Subject: [PATCH] *If responding with an existing entry, don't try to set --- src/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 8bca7da..098bef4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -108,8 +108,10 @@ const plugin: Plugin = { } let entry = (await getEntry(newEntry.pk)) as SignedRegistryEntry; - async function setAndRespond(entry: SignedRegistryEntry) { - await setEntry(newEntry); + async function setAndRespond(entry: SignedRegistryEntry, set = true) { + if (set) { + await setEntry(newEntry); + } sendDirectOrBroadcast( Message.create({ type: MessageType.CREATED, @@ -127,7 +129,7 @@ const plugin: Plugin = { setAndRespond(newEntry); return; } - setAndRespond(entry); + setAndRespond(entry, false); return; } setAndRespond(newEntry);