0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

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.
This commit is contained in:
Trevor Buckner
2024-09-04 15:50:32 -04:00
parent d5e367649e
commit c735ab7c35
2 changed files with 6 additions and 6 deletions

View File

@@ -380,7 +380,7 @@ const VaultPage = (props)=>{
<link href='/themes/V3/5ePHB/style.css' rel='stylesheet' />
{renderNavItems()}
<div className='content'>
<SplitPane hideMoveArrows>
<SplitPane showDividerButtons={false}>
<div className='form dataGroup'>{renderForm()}</div>
<div className='resultsContainer dataGroup'>

View File

@@ -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,