From 06a9f95979c21bb5d8878282fd8280848df736ef Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 4 Dec 2025 16:23:14 +0200 Subject: [PATCH] chore(react/launch_bar): remove old file --- apps/client/src/widgets/bookmark_buttons.ts | 64 --------------------- 1 file changed, 64 deletions(-) delete mode 100644 apps/client/src/widgets/bookmark_buttons.ts diff --git a/apps/client/src/widgets/bookmark_buttons.ts b/apps/client/src/widgets/bookmark_buttons.ts deleted file mode 100644 index ef6cb97a1..000000000 --- a/apps/client/src/widgets/bookmark_buttons.ts +++ /dev/null @@ -1,64 +0,0 @@ -import FlexContainer from "./containers/flex_container.js"; -import BookmarkFolderWidget from "./buttons/bookmark_folder.js"; -import froca from "../services/froca.js"; -import utils from "../services/utils.js"; -import type { EventData } from "../components/app_context.js"; -import type Component from "../components/component.js"; - -interface BookmarkButtonsSettings { - titlePlacement?: string; -} - -export default class BookmarkButtons extends FlexContainer { - private settings: BookmarkButtonsSettings; - private noteIds: string[]; - - constructor(isHorizontalLayout: boolean) { - super(isHorizontalLayout ? "row" : "column"); - - this.contentSized(); - this.settings = {}; - this.noteIds = []; - } - - async refresh(): Promise { - const bookmarkParentNote = await froca.getNote("_lbBookmarks"); - - if (!bookmarkParentNote) { - return; - } - - for (const note of await bookmarkParentNote.getChildNotes()) { - this.noteIds.push(note.noteId); - - let buttonWidget: OpenNoteButtonWidget | BookmarkFolderWidget = note.isLabelTruthy("bookmarkFolder") - ? new BookmarkFolderWidget(note); - - this.child(buttonWidget); - - this.$widget.append(buttonWidget.render()); - - buttonWidget.refreshIcon(); - } - - utils.reloadTray(); - } - - initialRenderCompleteEvent(): void { - this.refresh(); - } - - entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">): void { - if (loadResults.getBranchRows().find((branch) => branch.parentNoteId === "_lbBookmarks")) { - this.refresh(); - } - - if (loadResults.getAttributeRows().find((attr) => - attr.type === "label" && - attr.name && ["iconClass", "workspaceIconClass", "bookmarkFolder"].includes(attr.name) && - attr.noteId && this.noteIds.includes(attr.noteId) - )) { - this.refresh(); - } - } -}