Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

526 B
Raw Blame
import { readVoiceSettings, type VoiceSettings } from '@mimik/core/capture/voice/read-voice-settings';
import { useEffect, useState } from 'react';

export function useVoiceSettings(): VoiceSettings {
  const [voice, setVoice] = useState<VoiceSettings>({ enabled: false, hasApiKey: false });

  useEffect(() => {
    const read = () => void readVoiceSettings().then(setVoice);
    read();
    window.addEventListener('storage', read);
    return () => window.removeEventListener('storage', read);
  }, []);

  return voice;
}