diff --git a/js/sessionUtils.js b/js/sessionUtils.js index d9bc4cd..08988b9 100644 --- a/js/sessionUtils.js +++ b/js/sessionUtils.js @@ -183,19 +183,20 @@ function createLocalTrackFileCard(parentElement, id, browser){ fileInputElement.addEventListener('change', async e => { - const {files} = fileInputElement - const names = Array.from(files).map(({ name }) => name) + const names = Array.from(fileInputElement.files).map(({ name }) => name) if (names.length > 0) { - for (const name of names) { - const element = document.querySelector(`[data-filename="${ name }"]`) - if (null !== element) { - console.log(`Retrieved file named ${ element.innerText }`) + const listItemElement = document.querySelector(`[data-filename="${ name }"]`) + if (null !== listItemElement) { + console.log(`Retrieved file ${ name } is a local session file`) + listItemElement.style.backgroundColor = 'pink' + const inputElement = listItemElement.querySelector('input') + inputElement.checked = true + } else { + console.log(`Retrieved file ${ name } is NOT a local session file`) } } - - } })