Skip to content

Commit

Permalink
Removed old unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
milutinke committed Nov 14, 2024
1 parent 497f121 commit f699ee0
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions app/lib/hooks/useVoiceToText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,7 @@ export function useVoiceToText() {
throw new Error(errorData.error || 'Failed to convert voice to text');
}

const reader = response.body?.getReader();
const decoder = new TextDecoder();

let text = '';

if (reader) {
while (true) {
const { value, done } = await reader.read();
if (done) break;
text += decoder.decode(value);
}
}

const text = await response.text();
return text;
} catch (error) {
toast.error(error instanceof Error ? error.message : 'Failed to convert voice to text');
Expand Down

0 comments on commit f699ee0

Please sign in to comment.