Skip to content

Commit

Permalink
Fixed Recording in Progress Info
Browse files Browse the repository at this point in the history
- Not sure when this happened.
- Now working as intended. When you start clocking it will display all the information on which topic, subtopic and project you're recording on
  • Loading branch information
programmingKyle committed Mar 17, 2024
1 parent 0451bbc commit d3e16c7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/inputHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ async function populateTopicSelect(){
return new Date(b.previousTime) - new Date(a.previousTime);
});

console.log(activeTopics);

activeTopics.forEach(element => {
const topicOption_el = document.createElement('option');
topicOption_el.textContent = element.topic;
topicOption_el.value = element.id;
topicOption_el.dataset.topicName = element.topic;
topicSelect_el.append(topicOption_el);
});
await populateSubtopicSelect(topicSelect_el.value);
Expand All @@ -45,6 +44,7 @@ async function populateSubtopicSelect(topic){
const subtopicOption_el = document.createElement('option');
subtopicOption_el.textContent = element.subtopic;
subtopicOption_el.value = element.id;
subtopicOption_el.dataset.subtopicName = element.subtopic;
subtopicSelect_el.append(subtopicOption_el);
}
});
Expand Down Expand Up @@ -87,7 +87,10 @@ function populateDisplayInputs(){
const currentSubtopicText_el = document.getElementById('currentSubtopicText');
const currentProjectText_el = document.getElementById('currentProjectText');

currentTimerTopicText_el.textContent = topicSelect_el.value;
currentSubtopicText_el.textContent = subtopicSelect_el.value === 'null' ? 'Not Selected' : subtopicSelect_el.value;
const selectedTopic = topicSelect_el.options[topicSelect_el.selectedIndex].dataset.topicName;
const selectedSubtopic = subtopicSelect_el.options[subtopicSelect_el.selectedIndex].dataset.subtopicName;

currentTimerTopicText_el.textContent = selectedTopic;
currentSubtopicText_el.textContent = subtopicSelect_el.value === 'null' ? 'Not Selected' : selectedSubtopic;
currentProjectText_el.textContent = projectInput_el.value;
}

0 comments on commit d3e16c7

Please sign in to comment.