algairim commented on a change in pull request #298:
URL: https://github.com/apache/brooklyn-ui/pull/298#discussion_r733628349



##########
File path: 
ui-modules/blueprint-composer/app/components/catalog-selector/catalog-selector.directive.js
##########
@@ -98,7 +104,17 @@ export function catalogSelectorDirective() {
         $scope.viewModes = PALETTE_VIEW_MODES;
         $scope.viewOrders = PALETTE_VIEW_ORDERS;
         if (!$scope.state) $scope.state = {};
-        if (!$scope.state.viewMode) $scope.state.viewMode = 
PALETTE_VIEW_MODES.normal;
+        if (!$scope.state.viewMode) {
+            const savedViewMode = sessionStore.getComposerViewMode(true);
+            $scope.state.viewMode = ((typeof savedViewMode === 'object') && 
(savedViewMode !== null))
+                ? savedViewMode
+                : PALETTE_VIEW_MODES.normal
+        };
+
+        if(!$scope.search) {
+            const savedSearch = sessionStore.getComposerSearch();
+            if (typeof savedSearch === 'string' && savedSearch.length) 
$scope.search = savedSearch;

Review comment:
       Add `else` condition to initialise it with an empty string, otherwise 
there is "undefined" displayed when switching between catalog sections.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to