Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

659 B
Raw Blame
import { useCallback, useEffect } from 'react'
import { triggerEdgeBump, triggerSelection } from '../platform/haptics'
import type { UseMobileDictationResult } from '../hooks/mobile-dictation-session-state'

/** Taps when recording begins and returns a stop that ticks. */
export function useMobileDictationHaptics(dictation: UseMobileDictationResult): () => void {
  // Fire on the commit, not the press: starting waits on the host and may fail.
  useEffect(() => {
    if (dictation.isRecording) {
      triggerEdgeBump()
    }
  }, [dictation.isRecording])

  return useCallback(() => {
    triggerSelection()
    void dictation.stop()
  }, [dictation])
}