chore(client/ts): fix build errors

This commit is contained in:
Elian Doran 2025-03-19 22:39:49 +02:00
parent 7c805eb427
commit ffa463f1fc
No known key found for this signature in database
3 changed files with 6 additions and 3 deletions

View File

@ -95,7 +95,7 @@ declare global {
className: string; className: string;
separateWordSearch: boolean; separateWordSearch: boolean;
caseSensitive: boolean; caseSensitive: boolean;
done: () => void; done?: () => void;
}); });
unmark(opts?: { unmark(opts?: {
done: () => void; done: () => void;

View File

@ -305,7 +305,10 @@ export default class FindWidget extends NoteContextAwareWidget {
const matchCase = this.$caseSensitiveCheckbox.prop("checked"); const matchCase = this.$caseSensitiveCheckbox.prop("checked");
const wholeWord = this.$matchWordsCheckbox.prop("checked"); const wholeWord = this.$matchWordsCheckbox.prop("checked");
const { totalFound, currentFound } = await this.handler?.performFind(searchTerm, matchCase, wholeWord); if (!this.handler) {
return;
}
const { totalFound, currentFound } = await this.handler.performFind(searchTerm, matchCase, wholeWord);
this.$totalFound.text(totalFound); this.$totalFound.text(totalFound);
this.$currentFound.text(currentFound); this.$currentFound.text(currentFound);

View File

@ -38,7 +38,7 @@ export default class FindInCode {
// See https://codemirror.net/addon/search/searchcursor.js for tips // See https://codemirror.net/addon/search/searchcursor.js for tips
const codeEditor = await this.getCodeEditor(); const codeEditor = await this.getCodeEditor();
if (!codeEditor) { if (!codeEditor) {
return; return { totalFound: 0, currentFound: 0 };
} }
const doc = codeEditor.doc; const doc = codeEditor.doc;