Skip to content

Commit

Permalink
fix(TTS, MO): disable popup foonotes so that they can be played inlin…
Browse files Browse the repository at this point in the history
…e as intended by content creators, see #2679
  • Loading branch information
danielweck committed Nov 30, 2024
1 parent 4a80487 commit fee5fda
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/renderer/reader/components/Reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,16 @@ class Reader extends React.Component<IProps, IState> {

private handleTTSPlay() {
ttsClickEnable(true);
ttsPlay(parseFloat(this.props.ttsPlaybackRate), this.props.ttsVoice);
let delay = 0;
if (!this.props.readerConfig?.noFootnotes) {
delay = 100;
// console.log("TTS PLAY ==> NO_FOOTNOTES MUST BE TRUE (POPUP DISABLED), SWITCHING...");
this.props.setConfig({ noFootnotes: true });
// TODO: skippability should be disabled when user explicitly "requests" a skippable item, such as when clicking on a note reference hyperlink, or even on a skippable element itself(?)
}
setTimeout(() => {
ttsPlay(parseFloat(this.props.ttsPlaybackRate), this.props.ttsVoice);
}, delay);
}
private handleTTSPause() {
ttsPause();
Expand Down Expand Up @@ -2710,7 +2719,16 @@ class Reader extends React.Component<IProps, IState> {

private handleMediaOverlaysPlay() {
mediaOverlaysClickEnable(true);
mediaOverlaysPlay(parseFloat(this.props.mediaOverlaysPlaybackRate));
let delay = 0;
if (!this.props.readerConfig?.noFootnotes) {
delay = 100;
// console.log("MO PLAY ==> NO_FOOTNOTES MUST BE TRUE (POPUP DISABLED), SWITCHING...");
this.props.setConfig({ noFootnotes: true });
// TODO: skippability should be disabled when user explicitly "requests" a skippable item, such as when clicking on a note reference hyperlink, or even on a skippable element itself(?)
}
setTimeout(() => {
mediaOverlaysPlay(parseFloat(this.props.mediaOverlaysPlaybackRate));
}, delay);
}
private handleMediaOverlaysPause() {
mediaOverlaysPause();
Expand Down

0 comments on commit fee5fda

Please sign in to comment.