Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

621 B
Raw Blame
import { useEffect } from 'react';

/** Route API anchors even when Settings is already open on another category. */
export function useOpenApiDeepLink(openSettingsTab) {
  useEffect(() => {
    const handleHash = () => {
      const hash = window.location.hash;
      if (
        hash &&
        (hash.startsWith('#tag/') || hash.includes('speech-platform') || hash.includes('openapi'))
      ) {
        openSettingsTab('openapi');
      }
    };
    handleHash();
    window.addEventListener('hashchange', handleHash);
    return () => window.removeEventListener('hashchange', handleHash);
  }, [openSettingsTab]);
}