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.

689 B
Raw Blame
import { type Accessor, createEffect } from 'solid-js';
import type { CrmViewConfig } from '../core/saved-view';

export function createDefaultCrmView(input: {
  personalLoading: Accessor<boolean>;
  teamLoading: Accessor<boolean>;
  personal: Accessor<CrmViewConfig | undefined>;
  team: Accessor<CrmViewConfig | undefined>;
  apply(config: CrmViewConfig): void;
}) {
  let applied = false;
  // Synchronize asynchronously loaded preferences into the live workspace once.
  createEffect(() => {
    if (applied || input.personalLoading() || input.teamLoading()) return;
    applied = true;
    const config = input.personal() ?? input.team();
    if (config) input.apply(config);
  });
}