Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix a bug where this.props.setPanelState is not defined
Browse files Browse the repository at this point in the history
This gets fired from the Shot page (the property is defined on the Shot Index page)
  • Loading branch information
ianb committed Nov 14, 2017
1 parent 1c6dcf2 commit 2c20056
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions server/src/share-buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,26 @@ exports.ShareButton = class ShareButton extends React.Component {
let show = !this.state.display;
this.setState({display: show});
if (show) {
this.props.setPanelState("panel-open");
if (this.props.setPanelState) {
this.props.setPanelState("panel-open");
}
sendEvent(
this.props.isOwner ? "start-share-owner" : "start-share-non-owner",
"navbar");
} else {
this.props.setPanelState("panel-closed");
if (this.props.setPanelState) {
this.props.setPanelState("panel-closed");
}
this.shareDiv.blur();
sendEvent("cancel-share");
}
}

onPanelClose() {
this.setState({display: false});
this.props.setPanelState("panel-closed");
if (this.props.setPanelState) {
this.props.setPanelState("panel-closed");
}
}
};

Expand Down

0 comments on commit 2c20056

Please sign in to comment.