Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

577 B
Raw Blame
import { fireAndForget } from '@core/util/fireAndForget';
import { impactFeedback } from '@tauri-apps/plugin-haptics';
import { isNativeMobilePlatform } from './isNativeMobilePlatform';

type ImpactStyle = Parameters<typeof impactFeedback>[0];

export function hapticImpact(style: ImpactStyle): void {
  if (!isNativeMobilePlatform()) return;
  fireAndForget(performImpact(style), 'haptics');
}

async function performImpact(style: ImpactStyle) {
  try {
    await impactFeedback(style);
  } catch {
    // Haptics are optional on tablets and devices without a vibrator.
  }
}