*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;
|
let entry = (await getEntry(newEntry.pk)) as SignedRegistryEntry;
|
||||||
|
|
||||||
async function setAndRespond(entry: SignedRegistryEntry, set = true) {
|
async function setAndRespond(entry: SignedRegistryEntry, set = true) {
|
||||||
|
let ret = true;
|
||||||
if (set) {
|
if (set) {
|
||||||
await setEntry(newEntry);
|
ret = await setEntry(newEntry);
|
||||||
}
|
}
|
||||||
|
if (ret) {
|
||||||
sendDirectOrBroadcast(
|
sendDirectOrBroadcast(
|
||||||
Message.create({
|
Message.create({
|
||||||
type: MessageType.CREATED,
|
type: MessageType.CREATED,
|
||||||
|
@ -123,6 +125,7 @@ const plugin: Plugin = {
|
||||||
origin
|
origin
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (entry) {
|
if (entry) {
|
||||||
if (newEntry.revision <= entry.revision) {
|
if (newEntry.revision <= entry.revision) {
|
||||||
|
|
Reference in New Issue