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.

628 B
Raw Blame
import { type Accessor, createEffect, untrack } from 'solid-js';

/** Reconcile saved scope only against successfully loaded accounts, independently of UI. */
export function createInboxSelectionReconciliation(options: {
  selectedIds: Accessor<readonly string[] | undefined>;
  loadedLinks: Accessor<readonly { id: string }[] | undefined>;
  clearSelection: () => void;
}) {
  createEffect(() => {
    const links = options.loadedLinks();
    if (links === undefined) return;
    if (
      options.selectedIds()?.some((id) => !links.some((link) => link.id === id))
    ) {
      untrack(options.clearSelection);
    }
  });
}