Merge pull request #3695 from node-red/fix-dynamic-link-call

Ensure link-call cache is updated when link-in is modified
This commit is contained in:
Nick O'Leary
2022-06-28 20:56:33 +01:00
committed by GitHub
3 changed files with 51 additions and 11 deletions

View File

@@ -109,16 +109,13 @@ module.exports = function(RED) {
},
remove(node) {
const target = generateTarget(node);
const tn = this.getTarget(target.name, target.flowId);
if (tn) {
const targs = this.getTargets(tn.name);
const idx = getIndex(targs, tn.id);
if (idx > -1) {
targs.splice(idx, 1);
}
if (targs.length === 0) {
delete registry.name[tn.name];
}
const targs = this.getTargets(target.name);
const idx = getIndex(targs, target.id);
if (idx > -1) {
targs.splice(idx, 1);
}
if (targs.length === 0) {
delete registry.name[tn.name];
}
delete registry.id[target.id];
},