diff --git a/apps/client/src/widgets/note_icon.tsx b/apps/client/src/widgets/note_icon.tsx index 00ef7e78b..40dc3a916 100644 --- a/apps/client/src/widgets/note_icon.tsx +++ b/apps/client/src/widgets/note_icon.tsx @@ -2,6 +2,7 @@ import "./note_icon.css"; import { IconRegistry } from "@triliumnext/commons"; import { Dropdown as BootstrapDropdown } from "bootstrap"; +import clsx from "clsx"; import { t } from "i18next"; import { RefObject } from "preact"; import { useEffect, useRef, useState } from "preact/hooks"; @@ -164,9 +165,9 @@ function NoteIconList({ note, dropdownRef }: { onClick={(e) => { // Make sure we are not clicking on something else than a button. const clickedTarget = e.target as HTMLElement; - if (clickedTarget.tagName !== "SPAN" || clickedTarget.classList.length !== 2) return; + if (!clickedTarget.classList.contains("tn-icon")) return; - const iconClass = Array.from(clickedTarget.classList.values()).join(" "); + const iconClass = Array.from(clickedTarget.classList.values()).filter(c => c !== "tn-icon").join(" "); if (note) { const attributeToSet = note.hasOwnedLabel("workspace") ? "workspaceIconClass" : "iconClass"; attributes.setLabel(note.noteId, attributeToSet, iconClass); @@ -178,7 +179,7 @@ function NoteIconList({ note, dropdownRef }: { (iconData?.icons ?? []).map(({ id, terms, iconPack }) => ( )) diff --git a/apps/server/src/services/export/zip/share_theme.ts b/apps/server/src/services/export/zip/share_theme.ts index 127596895..493e98b48 100644 --- a/apps/server/src/services/export/zip/share_theme.ts +++ b/apps/server/src/services/export/zip/share_theme.ts @@ -10,6 +10,7 @@ import type BNote from "../../../becca/entities/bnote.js"; import { getClientDir, getShareThemeAssetDir } from "../../../routes/assets"; import { getDefaultTemplatePath, readTemplate, renderNoteForExport } from "../../../share/content_renderer"; import { getIconPacks, MIME_TO_EXTENSION_MAPPINGS, ProcessedIconPack } from "../../icon_packs"; +import log from "../../log"; import NoteMeta, { NoteMetaFile } from "../../meta/note_meta"; import { RESOURCE_DIR } from "../../resource_dir"; import { getResourceDir, isDev } from "../../utils"; @@ -152,7 +153,10 @@ export default class ShareThemeExportProvider extends ZipExportProvider { fontData = becca.getAttachment(iconPack.fontAttachmentId)?.getContent(); } - if (!fontData) continue; + if (!fontData) { + log.error(`Failed to find font data for icon pack ${iconPack.prefix} with attachment ID ${iconPack.fontAttachmentId}`); + continue; + }; const fontFileName = `assets/icon-pack-${iconPack.prefix.toLowerCase()}.${extension}`; this.archive.append(fontData, { name: fontFileName }); }