Read Aloud: Handle failure when trying to pause other tab
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run

https://forums.zotero.org/discussion/130920/tts-breaks-after-automatic-theme-changes
This commit is contained in:
Abe Jellinek 2026-04-16 16:25:54 -04:00
parent d2d4451165
commit 488fd29978

View file

@ -1963,7 +1963,16 @@ class ReaderTab extends ReaderInstance {
// If this tab was unpaused, pause all others
for (let reader of Zotero.Reader._readers) {
if (reader === this) continue;
reader.toggleReadAloudPaused(true);
try {
reader.toggleReadAloudPaused(true);
}
catch (e) {
// Failed to pause the other reader.
// This seems to be caused by the _internalReader being a
// dead object. Not clear why, but we can log and continue;
// if the other reader is dead, it's not playing audio.
Zotero.logError(e);
}
}
}
this._window.Zotero_Tabs.setAudioStatus(this.tabID, status);