diff --git a/apps/client/src/widgets/note_icon.tsx b/apps/client/src/widgets/note_icon.tsx index ed7a272c8..e70f2ae20 100644 --- a/apps/client/src/widgets/note_icon.tsx +++ b/apps/client/src/widgets/note_icon.tsx @@ -9,7 +9,7 @@ import { useEffect, useRef, useState } from "preact/hooks"; import FNote from "../entities/fnote"; import attributes from "../services/attributes"; import server from "../services/server"; -import Button from "./react/Button"; +import ActionButton from "./react/ActionButton"; import Dropdown from "./react/Dropdown"; import { FormDropdownDivider, FormListItem } from "./react/FormList"; import FormTextBox from "./react/FormTextBox"; @@ -119,6 +119,22 @@ function NoteIconList({ note, dropdownRef }: { autoFocus /> + {getIconLabels(note).length > 0 && ( +
+ { + if (!note) return; + for (const label of getIconLabels(note)) { + attributes.removeAttributeById(note.noteId, label.attributeId); + } + dropdownRef?.current?.hide(); + }} + /> +
+ )} + {glob.iconRegistry.sources.length > 0 && - {getIconLabels(note).length > 0 && ( -
-
- )} - {(iconData?.icons ?? []).map(({ id, terms }) => ( ))}