From 7f1eb9912708e915eb6048ddb1cd3cfd895d5543 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 7 Apr 2025 22:50:38 +0300 Subject: [PATCH] fix(client): build error and simplify doRefresh in type widgets --- .../app/widgets/type_widgets/abstract_split_type_widget.ts | 4 ++-- .../widgets/type_widgets/abstract_svg_split_type_widget.ts | 2 +- src/public/app/widgets/type_widgets/attachment_list.ts | 3 --- src/public/app/widgets/type_widgets/read_only_code.ts | 4 ++-- src/public/app/widgets/type_widgets/type_widget.ts | 6 ++++-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/public/app/widgets/type_widgets/abstract_split_type_widget.ts b/src/public/app/widgets/type_widgets/abstract_split_type_widget.ts index 72bb6bb23..3b1cb222b 100644 --- a/src/public/app/widgets/type_widgets/abstract_split_type_widget.ts +++ b/src/public/app/widgets/type_widgets/abstract_split_type_widget.ts @@ -168,10 +168,10 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget { this.#destroyResizer(); } - async doRefresh(note: FNote | null | undefined) { + async doRefresh(note: FNote) { this.#adjustLayoutOrientation(); - if (note && !this.isReadOnly) { + if (!this.isReadOnly) { await this.editorTypeWidget.initialized; this.editorTypeWidget.noteContext = this.noteContext; this.editorTypeWidget.spacedUpdate = this.spacedUpdate; diff --git a/src/public/app/widgets/type_widgets/abstract_svg_split_type_widget.ts b/src/public/app/widgets/type_widgets/abstract_svg_split_type_widget.ts index 061694349..24c2c1ae4 100644 --- a/src/public/app/widgets/type_widgets/abstract_svg_split_type_widget.ts +++ b/src/public/app/widgets/type_widgets/abstract_svg_split_type_widget.ts @@ -46,7 +46,7 @@ export default abstract class AbstractSvgSplitTypeWidget extends AbstractSplitTy $(window).on("resize", this.zoomHandler); } - async doRefresh(note: FNote | null | undefined) { + async doRefresh(note: FNote) { super.doRefresh(note); const blob = await note?.getBlob(); diff --git a/src/public/app/widgets/type_widgets/attachment_list.ts b/src/public/app/widgets/type_widgets/attachment_list.ts index cdb5161bc..aced1223c 100644 --- a/src/public/app/widgets/type_widgets/attachment_list.ts +++ b/src/public/app/widgets/type_widgets/attachment_list.ts @@ -45,9 +45,6 @@ export default class AttachmentListTypeWidget extends TypeWidget { } async doRefresh(note: Parameters[0]) { - // TriliumNextTODO: do we need to handle an undefined/null note? - if (!note) return false; - const $helpButton = $(`