mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 18:25:51 +01:00
feat(code): proper search for read-only notes
This commit is contained in:
@@ -247,16 +247,16 @@ export default class FindWidget extends NoteContextAwareWidget {
|
||||
}
|
||||
|
||||
async getHandler() {
|
||||
if (this.note?.type === "render") {
|
||||
return this.htmlHandler;
|
||||
}
|
||||
|
||||
const readOnly = await this.noteContext?.isReadOnly();
|
||||
|
||||
if (readOnly) {
|
||||
return this.htmlHandler;
|
||||
} else {
|
||||
return this.note?.type === "code" ? this.codeHandler : this.textHandler;
|
||||
switch (this.note?.type) {
|
||||
case "render":
|
||||
return this.htmlHandler;
|
||||
case "code":
|
||||
return this.codeHandler;
|
||||
case "text":
|
||||
return this.textHandler;
|
||||
default:
|
||||
const readOnly = await this.noteContext?.isReadOnly();
|
||||
return readOnly ? this.htmlHandler : this.textHandler;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user