*If we are setting the entry, only respond if successful
*If we are skipping the set, respond
This commit is contained in:
parent
c734832952
commit
9a3a933dc5
|
@ -109,9 +109,11 @@ const plugin: Plugin = {
|
|||
let entry = (await getEntry(newEntry.pk)) as SignedRegistryEntry;
|
||||
|
||||
async function setAndRespond(entry: SignedRegistryEntry, set = true) {
|
||||
let ret = true;
|
||||
if (set) {
|
||||
await setEntry(newEntry);
|
||||
ret = await setEntry(newEntry);
|
||||
}
|
||||
if (ret) {
|
||||
sendDirectOrBroadcast(
|
||||
Message.create({
|
||||
type: MessageType.CREATED,
|
||||
|
@ -123,6 +125,7 @@ const plugin: Plugin = {
|
|||
origin
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (entry) {
|
||||
if (newEntry.revision <= entry.revision) {
|
||||
|
|
Reference in New Issue