From 9b7aee23cc2b6fd1f2e0f0d1cd404efd22afebb2 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 4 Oct 2019 13:34:05 +0200 Subject: [PATCH] :zap: Do not add large amounts of data to variable selector --- .../src/components/VariableSelector.vue | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/packages/editor-ui/src/components/VariableSelector.vue b/packages/editor-ui/src/components/VariableSelector.vue index 9ced2f33b..63a1edfce 100644 --- a/packages/editor-ui/src/components/VariableSelector.vue +++ b/packages/editor-ui/src/components/VariableSelector.vue @@ -468,12 +468,27 @@ export default mixins( tempOutputData = this.getNodeOutputData(runData, parentNode[0], filterText, itemIndex, 0, 'main', outputIndex) as IVariableSelectorOption[]; if (tempOutputData) { - currentNodeData.push( - { - name: 'Input Data', - options: this.sortOptions(tempOutputData), - } - ); + if (JSON.stringify(tempOutputData).length < 102400) { + // Data is reasonable small (< 100kb) so add it + currentNodeData.push( + { + name: 'Input Data', + options: this.sortOptions(tempOutputData), + } + ); + } else { + // Data is to large so do not add + currentNodeData.push( + { + name: 'Input Data', + options: [ + { + name: '[Data to large]', + } + ], + } + ); + } } }