mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix searchForNotes API method to look for archived notes as well
This commit is contained in:
parent
bf231d31a2
commit
43ac712fca
@ -1,4 +1,3 @@
|
|||||||
import treeService from './tree.js';
|
|
||||||
import server from './server.js';
|
import server from './server.js';
|
||||||
import utils from './utils.js';
|
import utils from './utils.js';
|
||||||
import toastService from './toast.js';
|
import toastService from './toast.js';
|
||||||
@ -9,7 +8,6 @@ import protectedSessionService from './protected_session.js';
|
|||||||
import dateNotesService from './date_notes.js';
|
import dateNotesService from './date_notes.js';
|
||||||
import CollapsibleWidget from '../widgets/collapsible_widget.js';
|
import CollapsibleWidget from '../widgets/collapsible_widget.js';
|
||||||
import ws from "./ws.js";
|
import ws from "./ws.js";
|
||||||
import hoistedNoteService from "./hoisted_note.js";
|
|
||||||
import appContext from "./app_context.js";
|
import appContext from "./app_context.js";
|
||||||
import TabAwareWidget from "../widgets/tab_aware_widget.js";
|
import TabAwareWidget from "../widgets/tab_aware_widget.js";
|
||||||
import TabCachingWidget from "../widgets/tab_caching_widget.js";
|
import TabCachingWidget from "../widgets/tab_caching_widget.js";
|
||||||
|
@ -24,8 +24,6 @@ function setupSplit(left, right) {
|
|||||||
rightPaneWidth = 5;
|
rightPaneWidth = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(leftPaneWidth, rightPaneWidth);
|
|
||||||
|
|
||||||
if (left && right) {
|
if (left && right) {
|
||||||
instance = Split(['#left-pane', '#center-pane', '#right-pane'], {
|
instance = Split(['#left-pane', '#center-pane', '#right-pane'], {
|
||||||
sizes: [leftPaneWidth, 100 - leftPaneWidth - rightPaneWidth, rightPaneWidth],
|
sizes: [leftPaneWidth, 100 - leftPaneWidth - rightPaneWidth, rightPaneWidth],
|
||||||
|
@ -93,8 +93,6 @@ export default class TabManager extends Component {
|
|||||||
filteredTabs[0].active = true;
|
filteredTabs[0].active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("filteredTabs", filteredTabs);
|
|
||||||
|
|
||||||
await this.tabsUpdate.allowUpdateWithoutChange(async () => {
|
await this.tabsUpdate.allowUpdateWithoutChange(async () => {
|
||||||
for (const tab of filteredTabs) {
|
for (const tab of filteredTabs) {
|
||||||
await this.openTabWithNote(tab.notePath, tab.active, tab.tabId, tab.hoistedNoteId);
|
await this.openTabWithNote(tab.notePath, tab.active, tab.tabId, tab.hoistedNoteId);
|
||||||
|
@ -92,13 +92,15 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} query
|
* @param {string} query
|
||||||
* @param {SearchContext} [searchContext]
|
* @param {Object} [searchParams]
|
||||||
* @returns {Note[]}
|
* @returns {Note[]}
|
||||||
*/
|
*/
|
||||||
this.searchForNotes = (query, searchContext) => {
|
this.searchForNotes = (query, searchParams = {}) => {
|
||||||
searchContext = searchContext || new SearchContext();
|
if (searchParams.includeArchivedNotes === undefined) {
|
||||||
|
searchParams.includeArchivedNotes = true;
|
||||||
|
}
|
||||||
|
|
||||||
const noteIds = searchService.findNotesWithQuery(query, searchContext)
|
const noteIds = searchService.findNotesWithQuery(query, new SearchContext(searchParams))
|
||||||
.map(sr => sr.noteId);
|
.map(sr => sr.noteId);
|
||||||
|
|
||||||
return repository.getNotes(noteIds);
|
return repository.getNotes(noteIds);
|
||||||
|
@ -320,6 +320,12 @@ function getEntityChangesRecords(entityChanges) {
|
|||||||
let length = 0;
|
let length = 0;
|
||||||
|
|
||||||
for (const entityChange of entityChanges) {
|
for (const entityChange of entityChanges) {
|
||||||
|
if (entityChange.isErased) {
|
||||||
|
records.push({entityChange});
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const entity = getEntityChangeRow(entityChange.entityName, entityChange.entityId);
|
const entity = getEntityChangeRow(entityChange.entityName, entityChange.entityId);
|
||||||
|
|
||||||
if (entityChange.entityName === 'options' && !entity.isSynced) {
|
if (entityChange.entityName === 'options' && !entity.isSynced) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user