fix(transcription): handle nullish params and normalize cloudTranscriptionMode in resolveStreamingFallbackTarget - #1830
Conversation
…ptionMode in resolveStreamingFallbackTarget (OpenWhispr#1829)
|
Thanks @hsusul — closing with #1829 (same convention as the #1840 note). The only caller passes Thanks for the continued energy! 🙏 |
Fixes #1829
Problem
In
src/helpers/transcriptionFallback.js:resolveStreamingFallbackTargetthrewTypeError: Cannot destructure property 'useLocalWhisper' of 'undefined' / 'null'when called without arguments or passednull/undefined.cloudTranscriptionMode === "openwhispr"did not normalize casing or whitespace, treating"OpenWhispr"as non-cloud and returning"byok".Solution
params || {}before destructuring.cloudTranscriptionModewithtrim().toLowerCase().test/helpers/transcriptionFallback.test.js.Verification
node --test test/helpers/transcriptionFallback.test.js(passes, 4/4 tests)npm run typecheck(passes, 0 errors)npm run lint(passes, 0 errors)npm run i18n:check(passes)npm run build:renderer(passes)git diff --check(clean)