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 froca 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 recentChangesRows = await server.get('recent-changes/' + ancestorNoteId); // preload all notes into cache await froca.getNotes(recentChangesRows.map(r => r.noteId), true); $content.empty(); if (recentChangesRows.length === 0) { $content.append("No changes yet ..."); } const groupedByDate = groupByDate(recentChangesRows); for (const [dateDay, dayChanges] of groupedByDate) { const $changesList = $('