diff options
author | Aijana Schumann <aijana.schumann@highstreet-technologies.com> | 2020-04-09 02:07:03 +0200 |
---|---|---|
committer | Aijana Schumann <aijana.schumann@highstreet-technologies.com> | 2020-04-09 02:07:03 +0200 |
commit | 4b87cf4d3c50dacb356c8e53a80bbabcba14b621 (patch) | |
tree | 8b1329c1d800c2bad0a20c77c16d553ab59ef5d5 /sdnr/wt/odlux/apps/connectApp/src/handlers | |
parent | edd588090a36a213cde431c02b295e51fcfe8ed0 (diff) |
Connect App Bugfix
Fix too many network calls made for gui cuttrough
Issue-ID: SDNC-1152
Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com>
Change-Id: I3f63d2f81ace802768d3e8814899de8d32dd4d11
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp/src/handlers')
-rw-r--r-- | sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts index 23a801424..302a981eb 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts @@ -43,14 +43,17 @@ const currentOpenPanelHandler: IActionHandler<PanelId> = (state = null, action) interface guiCutThroughState { searchedElements: guiCutThrough[]; notSearchedElements: string[]; + unsupportedElements: string[]; } -const guiCutThroughHandler: IActionHandler<guiCutThroughState> = (state = { searchedElements: [], notSearchedElements: [] }, action) => { +const guiCutThroughHandler: IActionHandler<guiCutThroughState> = (state = { searchedElements: [], notSearchedElements: [], unsupportedElements:[] }, action) => { if (action instanceof AddWebUriList) { let notSearchedElements: string[]; let searchedElements: guiCutThrough[]; + let unsupportedElements: string[]; notSearchedElements = state.notSearchedElements.concat(action.notSearchedElements); + unsupportedElements = state.unsupportedElements.concat(action.unsupportedElements); //remove elements, which were just searched if (action.newlySearchedElements) { @@ -61,13 +64,14 @@ const guiCutThroughHandler: IActionHandler<guiCutThroughState> = (state = { sear searchedElements = state.searchedElements.concat(action.searchedElements); - state = { searchedElements: searchedElements, notSearchedElements: notSearchedElements } + state = { searchedElements: searchedElements, notSearchedElements: notSearchedElements, unsupportedElements: unsupportedElements } } else if (action instanceof RemoveWebUri) { const nodeId = action.element; const webUris = state.searchedElements.filter(item => item.nodeId !== nodeId); const knownElements = state.notSearchedElements.filter(item => item !== nodeId); - state = { notSearchedElements: knownElements, searchedElements: webUris }; + const unsupportedElement = state.unsupportedElements.filter(item => item != nodeId); + state = { notSearchedElements: knownElements, searchedElements: webUris, unsupportedElements: unsupportedElement }; } return state; } |