diff --git a/src/renderer/reader/components/Reader.tsx b/src/renderer/reader/components/Reader.tsx index 73c5113a0..0294de24d 100644 --- a/src/renderer/reader/components/Reader.tsx +++ b/src/renderer/reader/components/Reader.tsx @@ -537,6 +537,12 @@ class Reader extends React.Component { this.unregisterAllKeyboardListeners(); this.registerAllKeyboardListeners(); } + + if (oldProps.infoOpen === true && this.props.infoOpen === false) { // close + this.setState({shortcutEnable: true}); + } else if (oldProps.infoOpen === false && this.props.infoOpen === true) { // open + this.setState({shortcutEnable: false}); + } } public componentWillUnmount() { @@ -1479,13 +1485,6 @@ class Reader extends React.Component { private displayPublicationInfo(focusWhereAmI?: boolean) { if (this.props.publicationView) { - // TODO: subscribe to Redux action type == CloseRequest - // in order to reset shortcutEnable to true? Problem: must be specific to this reader window. - // So instead we subscribe to DOM event "Thorium:DialogClose", but this is a short-term hack! - this.setState({ - shortcutEnable: false, - }); - const readerReadingLocation = this.state.currentLocation ? this.state.currentLocation : undefined; this.props.displayPublicationInfo(this.props.publicationView.identifier, this.state.pdfPlayerNumberOfPages, this.state.divinaNumberOfPages, this.state.divinaContinousEqualTrue, readerReadingLocation, this.handleLinkUrl.bind(this), focusWhereAmI); }