diff --git a/app/src/history/doc.ts b/app/src/history/doc.ts index 4bfc32aee..6585f4295 100644 --- a/app/src/history/doc.ts +++ b/app/src/history/doc.ts @@ -108,6 +108,9 @@ export const openDocHistory = (options: { renderDoc(dialog.element, 1, options.id); historyEditor = new Protyle(options.app, docElement, { blockId: "", + history: { + created: "" + }, action: [Constants.CB_GET_HISTORY], render: { background: false, @@ -183,11 +186,13 @@ const getHistoryPath = (target: Element, op: string, id: string, cb: (path: stri if (path) { cb(path); } + const created = target.getAttribute("data-created"); + historyEditor.protyle.options.history.created = created; fetchPost("/api/history/getHistoryItems", { query: id, op, type: 3, - created: target.getAttribute("data-created") + created }, (response) => { cb(response.data.items[0].path); }); diff --git a/app/src/history/history.ts b/app/src/history/history.ts index dc88278f4..726906fb4 100644 --- a/app/src/history/history.ts +++ b/app/src/history/history.ts @@ -442,6 +442,9 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => { renderDoc(firstPanelElement, 1); historyEditor = new Protyle(app, docElement, { blockId: "", + history: { + created: "" + }, action: [Constants.CB_GET_HISTORY], render: { background: false, @@ -533,17 +536,18 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => { const opElement = firstPanelElement.querySelector('.b3-select[data-type="opselect"]') as HTMLSelectElement; const typeElement = firstPanelElement.querySelector('.b3-select[data-type="typeselect"]') as HTMLSelectElement; const notebookElement = firstPanelElement.querySelector('.b3-select[data-type="notebookselect"]') as HTMLSelectElement; + const created = target.getAttribute("data-created") fetchPost("/api/history/getHistoryItems", { notebook: notebookElement.value, query: inputElement.value, op: opElement.value, type: parseInt(typeElement.value), - created: target.getAttribute("data-created") + created }, (response) => { iconElement.classList.add("b3-list-item__arrow--open"); let html = ""; response.data.items.forEach((docItem: { title: string, path: string }) => { - html += `