Olá, segue a resolução do que foi feito em sala e eu reproduzi.
const paragrafoDescricaoTarefa = document.querySelector('.app__section-active-task-description');
let tarefas = JSON.parse(localStorage.getItem('tarefas')) || []
let tarefaSelecionada = null
let litarefaSelecionada = null
li.onclick = () => {
document.querySelectorAll('.app__section-task-list-item-active')
.forEach(elemento =>{
elemento.classList.remove('app__section-task-list-item-active')
})
if (tarefaSelecionada == tarefa) {
paragrafoDescricaoTarefa.textContent = ''
tarefaSelecionada = null
litarefaSelecionada = null
return
}
tarefaSelecionada = tarefa
litarefaSelecionada = li
paragrafoDescricaoTarefa.textContent = tarefa.descricao
li.classList.add('app__section-task-list-item-active')
}
return li
}
document.addEventListener('FocoFinalizado', ()=>{
if (tarefaSelecionada && litarefaSelecionada) {
litarefaSelecionada.classList.remove('app__section-task-list-item-active')
litarefaSelecionada.classList.add('app__section-task-list-item-complete')
litarefaSelecionada.querySelector('button').setAttribute('disabled','disabled')
}
})