From 0e4b685382d6b19935b130bc709f84bb163e12bf Mon Sep 17 00:00:00 2001 From: futpib Date: Fri, 16 Nov 2018 00:19:23 +0300 Subject: [PATCH] Allow killing modules by deleting sinks and sources --- components/graph/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/graph/index.js b/components/graph/index.js index 4ebc513..8f55023 100644 --- a/components/graph/index.js +++ b/components/graph/index.js @@ -524,10 +524,18 @@ class Graph extends React.Component { } onDeleteNode(selected) { + const pai = dgoToPai.get(selected); + if (selected.type === 'client') { this.props.killClientByIndex(selected.index); } else if (selected.type === 'module') { this.props.unloadModuleByIndex(selected.index); + } else if ( + (selected.type === 'sink' || selected.type === 'source') && + pai && + typeof pai.moduleIndex === 'number' + ) { + this.props.unloadModuleByIndex(pai.moduleIndex); } }