Skip to content

Commit

Permalink
Fixed type checking errors
Browse files Browse the repository at this point in the history
  • Loading branch information
milutinke committed Nov 14, 2024
1 parent b49f0c1 commit 2c5670a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions app/components/chat/BaseChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ interface BaseChatProps {
sendMessage?: (event: React.UIEvent, messageInput?: string) => void;
handleInputChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
enhancePrompt?: () => void;
isRecording: boolean;
converting: boolean;
onStartRecording: () => void;
onStopRecording: () => void;
onCancelRecording: () => void;
isRecording?: boolean;
converting?: boolean;
onStartRecording?: () => void;
onStopRecording?: () => void;
onCancelRecording?: () => void;
}

export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
Expand Down
6 changes: 3 additions & 3 deletions app/lib/hooks/useVoiceToText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export function useVoiceToText() {
});

if (!response.ok) {
const error = await response.json();
throw new Error(error.error || 'Failed to convert voice to text');
const errorData = (await response.json()) as { error: string };
throw new Error(errorData.error || 'Failed to convert voice to text');
}

const reader = response.body?.getReader();
Expand All @@ -43,4 +43,4 @@ export function useVoiceToText() {
};

return { converting, convertVoiceToText };
}
}
3 changes: 1 addition & 2 deletions app/lib/hooks/useWhisperCredentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export function useWhisperCredentials() {
setHasCredentials(false);
return;
}

const data = await response.json();
const data = await response.json() as { hasCredentials: boolean };
setHasCredentials(data.hasCredentials);
} catch (error) {
setHasCredentials(false);
Expand Down

0 comments on commit 2c5670a

Please sign in to comment.