From 35171fe2b44c0d2e44197d91d290d5b7192d56cf Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Fri, 30 Aug 2024 11:42:55 +0000 Subject: [PATCH] Fix a bug of find widget --- src/public/app/widgets/find.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/public/app/widgets/find.js b/src/public/app/widgets/find.js index 53a8e2604..d3d3dbcad 100644 --- a/src/public/app/widgets/find.js +++ b/src/public/app/widgets/find.js @@ -218,6 +218,10 @@ export default class FindWidget extends NoteContextAwareWidget { * @returns {Promise} */ async findNext(direction) { + if (this.$totalFound.text()=="?"){ + await this.performFind(); + return + } const searchTerm = this.$input.val(); if (waitForEnter && this.searchTerm !== searchTerm) { await this.performFind(); @@ -272,4 +276,10 @@ export default class FindWidget extends NoteContextAwareWidget { isEnabled() { return super.isEnabled() && ['text', 'code', 'render'].includes(this.note.type); } + + async entitiesReloadedEvent({loadResults}) { + if (loadResults.isNoteContentReloaded(this.noteId)) { + this.$totalFound.text("?") + } + } }