From 4e1b3def3c87d01edc50a62dc8c605142167f1bd Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 28 Aug 2020 14:02:40 +0200 Subject: [PATCH] Error branches --- FloatingSpace/UiObject.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/FloatingSpace/UiObject.js b/FloatingSpace/UiObject.js index 89db5cc2c..cd08551ab 100644 --- a/FloatingSpace/UiObject.js +++ b/FloatingSpace/UiObject.js @@ -738,6 +738,27 @@ function newUiObject() { thisObject.hasError = true if (duration === undefined) { duration = 1 } errorMessageCounter = 100 * duration + + /* + Next, we are going to try to inform the parent that this + node has an error, as a way to show the end user where the + node with error is. This is useful to detect errors in nodes + that are located at braches that are collapsed. + */ + + if (thisObject.payload !== undefined) { + if (thisObject.payload.parentNode !== undefined) { + if (thisObject.payload.parentNode.payload !== undefined) { + if (thisObject.payload.parentNode.payload.floatingObject !== undefined) { + if (thisObject.payload.parentNode.payload.floatingObject.isCollapsed === true || thisObject.payload.parentNode.payload.floatingObject.isParentCollapsed === true) { + if (thisObject.payload.parentNode.payload.uiObject !== true) { + thisObject.payload.parentNode.payload.uiObject.setErrorMessage('Error Inside this Branch') + } + } + } + } + } + } } }