1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Android: Close voice typing session when closing the editor (#11466)

This commit is contained in:
Henry Heino 2024-12-09 07:56:25 -08:00 committed by GitHub
parent 021cdf8034
commit df577bc08c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -78,6 +78,10 @@ const useWhisper = ({ locale, provider, onSetPreview, onText }: UseVoiceTypingPr
setMustDownloadModel(!(await builder.isDownloaded())); setMustDownloadModel(!(await builder.isDownloaded()));
}, [builder]); }, [builder]);
useEffect(() => () => {
void voiceTypingRef.current?.stop();
}, []);
return [error, mustDownloadModel, voiceTyping]; return [error, mustDownloadModel, voiceTyping];
}; };

View File

@ -75,7 +75,7 @@ class Whisper implements VoiceTypingSession {
public async stop() { public async stop() {
if (this.sessionId === null) { if (this.sessionId === null) {
logger.warn('Session already closed.'); logger.debug('Session already closed.');
return; return;
} }