Skip to content

Build your personal knowledge base with Trilium Notes

chore(react/launch_bar): remove old file

Elian Doran06a9f95979c2
diff --git a/apps/client/src/widgets/bookmark_buttons.ts b/apps/client/src/widgets/bookmark_buttons.ts
deleted file mode 100644
index ef6cb97a18..0000000000
--- 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<Component> {
- private settings: BookmarkButtonsSettings;
- private noteIds: string[];
-
- constructor(isHorizontalLayout: boolean) {
- super(isHorizontalLayout ? "row" : "column");
-
- this.contentSized();
- this.settings = {};
- this.noteIds = [];
- }
-
- async refresh(): Promise<void> {
- 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();
- }
- }
-}