From 44508ecff2928ce593fe94471f3fabf77061d9f0 Mon Sep 17 00:00:00 2001 From: Pierre Leroux Date: Tue, 7 Nov 2023 09:03:07 +0100 Subject: [PATCH] Revert "Fix(reader): enable reader keyboard shortcut on publication info close" This reverts commit b2b41b6c03393f2f43660b81ca8ca24d02f264a8. --- src/renderer/reader/components/Reader.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/renderer/reader/components/Reader.tsx b/src/renderer/reader/components/Reader.tsx index 0294de24d..73c5113a0 100644 --- a/src/renderer/reader/components/Reader.tsx +++ b/src/renderer/reader/components/Reader.tsx @@ -537,12 +537,6 @@ 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() { @@ -1485,6 +1479,13 @@ 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); }