fix display of buttons for revisions when there is none

This commit is contained in:
zadam 2020-05-07 23:14:21 +02:00
parent 115879ec4a
commit a3661cb763

View File

@ -37,6 +37,7 @@ export async function showNoteRevisionsDialog(noteId, noteRevisionId) {
async function loadNoteRevisions(noteId, noteRevId) { async function loadNoteRevisions(noteId, noteRevId) {
$list.empty(); $list.empty();
$content.empty(); $content.empty();
$titleButtons.empty();
note = appContext.tabManager.getActiveTabNote(); note = appContext.tabManager.getActiveTabNote();
revisionItems = await server.get(`notes/${noteId}/revisions`); revisionItems = await server.get(`notes/${noteId}/revisions`);
@ -62,6 +63,8 @@ async function loadNoteRevisions(noteId, noteRevId) {
$title.text("No revisions for this note yet..."); $title.text("No revisions for this note yet...");
noteRevisionId = null; noteRevisionId = null;
} }
$eraseAllRevisionsButton.toggle(revisionItems.length > 0);
} }
$dialog.on('shown.bs.modal', () => { $dialog.on('shown.bs.modal', () => {