Skip to content

Commit

Permalink
Removed a logger
Browse files Browse the repository at this point in the history
  • Loading branch information
milutinke committed Nov 14, 2024
1 parent e7c9764 commit 2b9bf11
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions app/lib/hooks/useWhisperCredentials.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
import { useEffect, useState } from 'react';
import { createScopedLogger } from '~/utils/logger';

const logger = createScopedLogger('useWhisperCredentials');

export function useWhisperCredentials() {
const [hasCredentials, setHasCredentials] = useState(false);
const [isLoading, setIsLoading] = useState(true);

useEffect(() => {
async function checkCredentials() {
try {
logger.info('Checking Whisper credentials...');
const response = await fetch('/api/voice-to-text');

if (!response.ok) {
logger.error('Failed to check credentials:', response.status);
setHasCredentials(false);
return;
}

const data = await response.json();
logger.info('Credentials check result:', JSON.stringify(data, null, 2));

logger.info('Setting hasCredentials to:', data.hasCredentials);
setHasCredentials(data.hasCredentials);
} catch (error) {
logger.error('Failed to check Whisper credentials:', error);
setHasCredentials(false);
} finally {
setIsLoading(false);
Expand Down

0 comments on commit 2b9bf11

Please sign in to comment.