Skip to content

Build your personal knowledge base with Trilium Notes

fix(spreadsheet): find not dismissed by changing note type

Elian Doranffb36f6a54e5
diff --git a/apps/client/src/widgets/type_widgets/spreadsheet/Spreadsheet.tsx b/apps/client/src/widgets/type_widgets/spreadsheet/Spreadsheet.tsx
index bbbc866840..59822e5260 100644
--- a/apps/client/src/widgets/type_widgets/spreadsheet/Spreadsheet.tsx
+++ b/apps/client/src/widgets/type_widgets/spreadsheet/Spreadsheet.tsx
@@ -29,7 +29,7 @@ import { IDialogService, ISidebarService } from '@univerjs/ui';
import { MutableRef, useEffect, useRef } from "preact/hooks";
import { t } from "../../../services/i18n";
-import { useColorScheme, useEffectiveReadOnly, useTriliumEvent } from "../../react/hooks";
+import { useColorScheme, useEffectiveReadOnly, useTriliumEvent, useTriliumEvents } from "../../react/hooks";
import { TypeWidgetProps } from "../type_widget";
import usePersistence from "./persistence";
@@ -199,7 +199,7 @@ function useSearchIntegration(apiRef: MutableRef<FUniver | undefined>) {
}
function useDismissDialogsOnNoteSwitch(apiRef: MutableRef<FUniver | undefined>) {
- useTriliumEvent("beforeNoteSwitch", () => {
+ useTriliumEvents(["beforeNoteSwitch", "noteTypeMimeChanged"], () => {
const univerAPI = apiRef.current;
if (!univerAPI) return;