Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

675 B
Raw Blame
import { useStore, useWatchImmediate } from 'dsh-tauri/client'
import { store } from '../store'
import { applyPrefillToComposer } from './prefill-bridge.utils'

interface PrefillBridgeProps {
  inputActions?: { setDraft: (text: string) => void }
}

export function PrefillBridge({ inputActions }: PrefillBridgeProps): null {
  const { pending } = useStore(store.prefill)

  useWatchImmediate([pending, inputActions], () => {
    if (pending === '')
      return
    if (inputActions !== undefined) {
      inputActions.setDraft(pending)
      store.prefill.clear()
      return
    }
    if (applyPrefillToComposer(pending))
      store.prefill.clear()
  })

  return null
}