fix(client/lightweight): boxicons not loading

This commit is contained in:
Elian Doran 2026-01-07 11:50:25 +02:00
parent c6d1457ad7
commit dd58eac4b0
No known key found for this signature in database

View File

@ -3,7 +3,7 @@
* This integrates with the shared route builder from @triliumnext/core.
*/
import { routes } from '@triliumnext/core';
import { routes, icon_packs as iconPackService } from '@triliumnext/core';
import { BrowserRouter, type BrowserRequest } from './browser_router';
type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
@ -46,12 +46,14 @@ export function registerRoutes(router: BrowserRouter): void {
}
function bootstrapRoute() {
const iconPacks = iconPackService.getIconPacks();
const assetPath = "./";
return {
assetPath: "./",
assetPath,
baseApiUrl: "../api/",
themeCssUrl: null,
themeUseNextAsBase: "next",
iconPackCss: "",
device: "desktop",
headingStyle: "default",
layoutOrientation: "vertical",
@ -59,7 +61,14 @@ function bootstrapRoute() {
isElectron: false,
hasNativeTitleBar: false,
hasBackgroundEffects: true,
currentLocale: { id: "en", rtl: false }
currentLocale: { id: "en", rtl: false },
iconPackCss: iconPacks
.map(p => iconPackService.generateCss(p, p.builtin
? `${assetPath}/fonts/${p.fontAttachmentId}.${iconPackService.MIME_TO_EXTENSION_MAPPINGS[p.fontMime]}`
: `api/attachments/download/${p.fontAttachmentId}`))
.filter(Boolean)
.join("\n\n"),
iconRegistry: iconPackService.generateIconRegistry(iconPacks),
};
}