mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
fix sync / fulltext issue
This commit is contained in:
@@ -72,10 +72,19 @@ class Note extends Entity {
|
||||
*/
|
||||
|
||||
/** @returns {Promise<*>} */
|
||||
async getContent() {
|
||||
async getContent(silentNotFoundError = false) {
|
||||
if (this.content === undefined) {
|
||||
const res = await sql.getRow(`SELECT content, hash FROM note_contents WHERE noteId = ?`, [this.noteId]);
|
||||
|
||||
if (!res) {
|
||||
if (silentNotFoundError) {
|
||||
return undefined;
|
||||
}
|
||||
else {
|
||||
throw new Error("Cannot find note content for noteId=" + this.noteId);
|
||||
}
|
||||
}
|
||||
|
||||
this.content = res.content;
|
||||
this.contentHash = res.contentHash; // used only for note_fulltext consistency check
|
||||
|
||||
|
||||
Reference in New Issue
Block a user