Something went wrong. Try again.
Save your Letterboxd diary in Obsidian
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637import { Notice } from "obsidian";import type { NotificationLevel } from "../types";
/** * Shows a notification based on the notification level setting * @param message - The message to display * @param level - Current notification level setting * @param type - Type of notification: "progress" (verbose only), "result" (verbose or newFilesOnly with changes), "error" (always) * @param hasNewFiles - Whether new files were created (for "result" type) */export function notify( message: string, level: NotificationLevel, type: "progress" | "result" | "error", hasNewFiles = false): void { if (type === "error") { // Errors always show new Notice(message); return; }
if (level === "silent") { return; }
if (level === "verbose") { new Notice(message); return; }
// level === "newFilesOnly" if (type === "result" && hasNewFiles) { new Notice(message); }}