Do not add large amounts of data to variable selector

This commit is contained in:
Jan Oberhauser 2019-10-04 13:34:05 +02:00
parent 199e7a7a2c
commit 9b7aee23cc

View file

@ -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]',
}
],
}
);
}
}
}