1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-18 09:35:20 +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()));
}, [builder]);
useEffect(() => () => {
void voiceTypingRef.current?.stop();
}, []);
return [error, mustDownloadModel, voiceTyping];
};

View File

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