mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
CS viewer: Fix read aloud broken after a configure with no changes
This commit is contained in:
parent
f82ea2036a
commit
0438ad7c94
@ -190,6 +190,7 @@ class Client:
|
||||
ut = self.current_utterance
|
||||
self.current_utterance = None
|
||||
ut.onstart = ut.onpause = ut.onend = ut.onerror = ut.onresume = None
|
||||
ut.removeEventListener('boundary', self.utterance_boundary_reached)
|
||||
window.speechSynthesis.cancel()
|
||||
|
||||
def resume_after_configure(self):
|
||||
@ -313,12 +314,11 @@ class Client:
|
||||
self.current_rate = rate
|
||||
if bar_pos is not current_bar_pos:
|
||||
sd.set('tts_bar_position', bar_pos)
|
||||
is_speaking = bool(window.speechSynthesis.speaking)
|
||||
if is_speaking:
|
||||
self.pause_for_configure()
|
||||
self.save_settings()
|
||||
if is_speaking:
|
||||
self.resume_after_configure()
|
||||
|
||||
is_speaking = bool(window.speechSynthesis.speaking)
|
||||
if is_speaking:
|
||||
self.pause_for_configure()
|
||||
self.save_settings()
|
||||
if is_speaking:
|
||||
self.resume_after_configure()
|
||||
self.onevent('configured')
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user