From c735ab7c35151cdd3f351b06e9d70c63c787faf0 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 4 Sep 2024 15:50:32 -0400 Subject: [PATCH] Fix crash on `metaData` tab Hiding the `moveBrew` etc. properties when `this.state.showMoveArrows == false` means when the `metaData` tab turns off the arrows it crashes because now some functions are undefined. Just using a whole separate property to avoid conflict. --- client/homebrew/pages/vaultPage/vaultPage.jsx | 2 +- shared/naturalcrit/splitPane/splitPane.jsx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/homebrew/pages/vaultPage/vaultPage.jsx b/client/homebrew/pages/vaultPage/vaultPage.jsx index 6140e0a25..e497fae24 100644 --- a/client/homebrew/pages/vaultPage/vaultPage.jsx +++ b/client/homebrew/pages/vaultPage/vaultPage.jsx @@ -380,7 +380,7 @@ const VaultPage = (props)=>{ {renderNavItems()}
- +
{renderForm()}
diff --git a/shared/naturalcrit/splitPane/splitPane.jsx b/shared/naturalcrit/splitPane/splitPane.jsx index ed31e03fe..32f183a99 100644 --- a/shared/naturalcrit/splitPane/splitPane.jsx +++ b/shared/naturalcrit/splitPane/splitPane.jsx @@ -7,8 +7,9 @@ const SplitPane = createClass({ displayName : 'SplitPane', getDefaultProps : function() { return { - storageKey : 'naturalcrit-pane-split', - onDragFinish : function(){} //fires when dragging + storageKey : 'naturalcrit-pane-split', + onDragFinish : function(){}, //fires when dragging + showDividerButtons : true }; }, @@ -18,8 +19,7 @@ const SplitPane = createClass({ windowWidth : 0, isDragging : false, moveSource : false, - moveBrew : false, - showMoveArrows : !this.props.hideMoveArrows, + moveBrew : false }; }, @@ -142,7 +142,7 @@ const SplitPane = createClass({ width={this.state.currentDividerPos} > {React.cloneElement(this.props.children[0], { - ...(this.state.showMoveArrows && { + ...(this.props.showDividerButtons && { moveBrew: this.state.moveBrew, moveSource: this.state.moveSource, setMoveArrows: this.setMoveArrows,