From c1ea1fd6086b5dfa61d4ffe1a0aab3388ca0712a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 7 Jan 2025 14:58:19 +0200 Subject: [PATCH] fix(build): build errors --- src/public/app/widgets/buttons/onclick_button.ts | 2 +- src/public/app/widgets/containers/launcher.ts | 3 ++- src/public/app/widgets/note_context_aware_widget.ts | 2 +- src/public/app/widgets/type_widgets/options/options_widget.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/public/app/widgets/buttons/onclick_button.ts b/src/public/app/widgets/buttons/onclick_button.ts index 62c448812..16685c6c6 100644 --- a/src/public/app/widgets/buttons/onclick_button.ts +++ b/src/public/app/widgets/buttons/onclick_button.ts @@ -1,4 +1,4 @@ -import AbstractButtonWidget, { AbstractButtonWidgetSettings, type AuxClickHandler, type ClickHandler } from "./abstract_button.js"; +import AbstractButtonWidget, { AbstractButtonWidgetSettings } from "./abstract_button.js"; import { t } from "../../services/i18n.js"; export type ClickHandler = (widget: OnClickButtonWidget, e: JQuery.ClickEvent) => void; diff --git a/src/public/app/widgets/containers/launcher.ts b/src/public/app/widgets/containers/launcher.ts index 4af2c31b5..bfeea5f6b 100644 --- a/src/public/app/widgets/containers/launcher.ts +++ b/src/public/app/widgets/containers/launcher.ts @@ -12,6 +12,7 @@ import TodayLauncher from "../buttons/launcher/today_launcher.js"; import HistoryNavigationButton from "../buttons/history_navigation.js"; import QuickSearchLauncherWidget from "../quick_search_launcher.js"; import FNote from "../../entities/fnote.js"; +import { CommandNames } from "../../components/app_context.js"; interface InnerWidget extends BasicWidget { settings?: { @@ -88,7 +89,7 @@ export default class LauncherWidget extends BasicWidget { return new CommandButtonWidget() .title(() => note.title) .icon(() => note.getIcon()) - .command(() => note.getLabelValue("command")); + .command(() => note.getLabelValue("command") as CommandNames); } async initCustomWidget(note: FNote) { diff --git a/src/public/app/widgets/note_context_aware_widget.ts b/src/public/app/widgets/note_context_aware_widget.ts index a90f14f2c..5e1ec7850 100644 --- a/src/public/app/widgets/note_context_aware_widget.ts +++ b/src/public/app/widgets/note_context_aware_widget.ts @@ -11,7 +11,7 @@ class NoteContextAwareWidget extends BasicWidget { protected noteContext?: NoteContext; - isNoteContext(ntxId: string) { + isNoteContext(ntxId: string | null | undefined) { if (Array.isArray(ntxId)) { return this.noteContext && ntxId.includes(this.noteContext.ntxId); } diff --git a/src/public/app/widgets/type_widgets/options/options_widget.ts b/src/public/app/widgets/type_widgets/options/options_widget.ts index 1b80996ad..77d84d6ef 100644 --- a/src/public/app/widgets/type_widgets/options/options_widget.ts +++ b/src/public/app/widgets/type_widgets/options/options_widget.ts @@ -63,7 +63,7 @@ export default class OptionsWidget extends NoteContextAwareWidget } } - async refreshWithNote(note: FNote) { + async refreshWithNote(note: FNote | null | undefined) { const options = await server.get('options'); if (options) {