Skip to content

Commit

Permalink
Revert "Fix(reader): enable reader keyboard shortcut on publication i…
Browse files Browse the repository at this point in the history
…nfo close"

This reverts commit b2b41b6.
  • Loading branch information
panaC committed Nov 7, 2023
1 parent bddc4b2 commit 44508ec
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/renderer/reader/components/Reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,6 @@ class Reader extends React.Component<IProps, IState> {
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() {
Expand Down Expand Up @@ -1485,6 +1479,13 @@ class Reader extends React.Component<IProps, IState> {

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);
}
Expand Down

0 comments on commit 44508ec

Please sign in to comment.