Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(icon packs): build the icon pack CSS once per bootstrap
Elian Dorane4b302198373
diff --git a/apps/server/src/routes/index.ts b/apps/server/src/routes/index.tsindex 60f324efe7..69b69d35ee 100644--- a/apps/server/src/routes/index.ts+++ b/apps/server/src/routes/index.ts@@ -1,5 +1,5 @@import { BootstrapDefinition } from "@triliumnext/commons";-import { attributes, BNote, getSharedBootstrapItems, icon_packs as iconPackService, options as optionService, password as passwordService, sql_init, task_states } from "@triliumnext/core";+import { attributes, BNote, getSharedBootstrapItems, options as optionService, password as passwordService, sql_init } from "@triliumnext/core";import type { Request, Response } from "express";import packageJson from "../../package.json" with { type: "json" };@@ -153,7 +153,6 @@ export function bootstrap(req: Request, res: Response) {const options = optionService.getOptionMap();const nativeTitleBarVisible = options.nativeTitleBarVisible === "true";- const iconPacks = iconPackService.getIconPacks();// One-shot: consume the enrollment flag set by the OIDC afterCallback so the client toasts the// successful connection exactly once after the post-enrollment redirect.@@ -182,16 +181,7 @@ export function bootstrap(req: Request, res: Response) {&& isElectronRenderer&& (supportsBackgroundMaterial || isMac)&& !nativeTitleBarVisible,- isMainWindow: view === "mobile" ? true : !req.query.extraWindow,- iconPackCss: [- ...iconPacks- .map((p: iconPackService.ProcessedIconPack) => iconPackService.generateCss(p, p.builtin- ? `${assetPath}/fonts/${p.fontAttachmentId}.${iconPackService.MIME_TO_EXTENSION_MAPPINGS[p.fontMime]}`- : `api/attachments/download/${p.fontAttachmentId}`)),- task_states.generateTaskStateCss(iconPacks)- ]- .filter(Boolean)- .join("\n\n"),+ isMainWindow: view === "mobile" ? true : !req.query.extraWindow} satisfies BootstrapDefinition);}