diff --git a/src/index.js b/src/index.js index b6ca9b7..8670d64 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,7 @@ const mappings = new Map(JSON.parse(localStorage.getItem('mappings')) || []); let statusLine = document.getElementById('status'); // store for when done with sorting TODO display let splash = document.getElementById('current-file').innerHTML; +let noFiles = document.getElementById('file-list').innerHTML; let history = []; @@ -87,6 +88,10 @@ function renderMoveButtons() { function renderFileList() { const fileListDiv = document.getElementById('file-list'); + if (fileList.length == 0) { + fileListDiv.innerHTML = noFiles; + return; + } fileListDiv.innerHTML = ''; fileList.forEach(file => { const p = document.createElement('p'); @@ -95,7 +100,7 @@ function renderFileList() { classes += " selected-file-list-item"; } p.setAttribute("class", classes) - p.innerHTML = file; + p.textContent = file; fileListDiv.appendChild(p); }); }