Windows: Dismissing translation popup during pronunciation crashes and corrupts session state
Bug Description
On Readest 0.12.10 for Windows, dismissing the translation popup while pronunciation is still playing crashes the reader. Pressing Back returns to the book, but the session remains in a broken state: after that, opening Translation and clicking outside the popup crashes again even without starting pronunciation. Only completely quitting and restarting Readest restores normal behavior.
The translation result and pronunciation both load correctly before dismissal. This appears to be a popup/selection/audio cleanup issue rather than a translation lookup failure.
Error details
Cannot read properties of undefined (reading 'trim')
Browser: Edge 153.0.0.0
TypeError: Cannot read properties of undefined (reading 'trim')
at As (http://tauri.localhost/_next/static/chunks/21wtkir76y4kj.js:186:140715)
at Ap (http://tauri.localhost/_next/static/chunks/21wtkir76y4kj.js:186:152477)Recovery
The Back button only returns to the reader visually; it does not clear the broken state. The application must be completely closed and restarted to recover.
Steps to Reproduce
- Open an EPUB book.
- Select a word and choose Dictionary.
- In the popup, click the pronunciation/speaker button.
- Before pronunciation playback finishes, click an empty area outside the popup.
- The global error page appears with
Cannot read properties of undefined (reading 'trim'). - Click Back on the error page. The book becomes visible again.
- Select a word and choose Dictionary again, but do not start pronunciation.
- Click an empty area outside the popup.
- The same crash occurs again.
- Completely quit and restart Readest; normal behavior is restored until the issue is triggered again.
Expected Behavior
Clicking outside the translation popup should close it safely. If pronunciation is playing, playback should either continue safely or stop cleanly. Dismissing the popup must not crash the reader or leave persistent broken session state, and returning from an error should restore normal popup behavior without requiring an application restart.
Reproduction File
No response
Operating System
Windows
OS Version
Windows 11, build 26200
Readest Version
0.12.10
Custom CSS
None
Source: readest/readest