yogevbd 6 years ago
parent
commit
05b3f5808f
1 changed files with 5 additions and 7 deletions
  1. 5
    7
      lib/src/commands/LayoutTreeCrawler.ts

+ 5
- 7
lib/src/commands/LayoutTreeCrawler.ts View File

@@ -63,7 +63,7 @@ export class LayoutTreeCrawler {
63 63
       this._normalizeButtons(passedOptions.topBar.leftButtons, (buttons, style) => {
64 64
         passedOptions.topBar.leftButtons = buttons;
65 65
 
66
-        if (staticOptions.topBar) {
66
+        if (staticOptions.topBar && buttons) {
67 67
           this._applyButtonsStyle(staticOptions.topBar.leftButtons, style);
68 68
         }
69 69
       });
@@ -71,7 +71,7 @@ export class LayoutTreeCrawler {
71 71
       this._normalizeButtons(passedOptions.topBar.rightButtons, (buttons, style) => {
72 72
         passedOptions.topBar.rightButtons = buttons;
73 73
 
74
-        if (staticOptions.topBar) {
74
+        if (staticOptions.topBar && buttons) {
75 75
           this._applyButtonsStyle(staticOptions.topBar.rightButtons, style);
76 76
         }
77 77
       });
@@ -87,11 +87,9 @@ export class LayoutTreeCrawler {
87 87
   }
88 88
 
89 89
   _applyButtonsStyle(buttons, style) {
90
-    if (buttons) {
91
-      buttons.forEach((button) => {
92
-        _.merge(button, style);
93
-      });
94
-    }
90
+    buttons.forEach((button) => {
91
+      _.merge(button, style);
92
+    });
95 93
   }
96 94
 
97 95
   _assertKnownLayoutType(type) {