Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

575 B
Raw Blame
import { api } from "@/lib/api";
import { readEditorBodyFontPreference } from "@/lib/editor-body-font";

let lastPublished: string | undefined;

export const syncPublishedNoteBodyFont = async () => {
  const preference = readEditorBodyFontPreference();
  const bodyFont = preference.choice === "system" || preference.choice === "custom" ? null : preference.choice;
  const marker = bodyFont ?? "";
  if (lastPublished === marker) return;
  lastPublished = marker;
  try {
    await api.updatePublishedNoteBodyFont(bodyFont);
  } catch {
    lastPublished = undefined;
  }
};