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.

551 B
Raw Blame
import { createSignal } from 'solid-js';

/** Serialize writes without dimming controls on unrelated email rows. */
export function createEmailRowActionState() {
  const [pendingRowId, setPendingRowId] = createSignal<string>();

  return {
    isPending: (rowId: string) => pendingRowId() === rowId,
    async run(rowId: string, action: () => Promise<void>) {
      if (pendingRowId() !== undefined) return;

      setPendingRowId(rowId);
      try {
        await action();
      } finally {
        setPendingRowId(undefined);
      }
    },
  };
}