import linkService from '../services/link.js'; import utils from '../services/utils.js'; import server from '../services/server.js'; import treeService from "../services/tree.js"; import treeCache from "../services/tree_cache.js"; import appContext from "../services/app_context.js"; import hoistedNoteService from "../services/hoisted_note.js"; const $dialog = $("#recent-changes-dialog"); const $content = $("#recent-changes-content"); export async function showDialog(ancestorNoteId) { utils.openDialog($dialog); if (!ancestorNoteId) { ancestorNoteId = hoistedNoteService.getHoistedNoteId(); } const result = await server.get('recent-changes/' + ancestorNoteId); // preload all notes into cache await treeCache.getNotes(result.map(r => r.noteId), true); $content.empty(); if (result.length === 0) { $content.append("No changes yet ..."); } const groupedByDate = groupByDate(result); for (const [dateDay, dayChanges] of groupedByDate) { const $changesList = $('