Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

609 B
Raw Blame
import type { PreviewViewportSetting } from "@akeru/contracts";

export function reconcileLockedAspectRatio(
  current: number | null,
  viewportAspectRatio: number | null,
): number | null {
  return current === null || viewportAspectRatio === null ? null : viewportAspectRatio;
}

export async function commitViewportAndAspectRatio(
  setting: PreviewViewportSetting,
  aspectRatio: number | null,
  onChange: (setting: PreviewViewportSetting) => Promise<void>,
  onAspectRatioChange: (aspectRatio: number | null) => void,
): Promise<void> {
  await onChange(setting);
  onAspectRatioChange(aspectRatio);
}