Skip to content

Commit

Permalink
Consistency Fix
Browse files Browse the repository at this point in the history
- Basically no matter how the user tries to add a topic, subtopic or make a new project name it will always be in the same format now. First it will convert everything to lowercase and then capitalize the first letter of every word. Should be working as intended now
  • Loading branch information
programmingKyle committed Mar 17, 2024
1 parent f529a8c commit 0451bbc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/subtopicHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function addSubtopicListeners(){

confirmAddSubtopicButton_el.addEventListener('click', async () => {
if (subtopicNameInput_el.value === '') return subtopicNameInput_el.classList.add('error');
const words = subtopicNameInput_el.value.split(' ');
const words = subtopicNameInput_el.value.toLowerCase().split(' ');
const formattedWords = words.map(word => capitalizeFirstLetter(word));
const formattedTopic = formattedWords.join(' ');
const result = await api.subtopicHandler({request: 'Add', topicID: topicNameSelect_el.value, subtopicName: formattedTopic});
Expand Down
2 changes: 1 addition & 1 deletion src/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function formatTime(milliseconds){
};

async function logTimeHandler(time){
const words = projectInput_el.value.split(' ');
const words = projectInput_el.value.toLowerCase().split(' ');
const formattedWords = words.map(word => capitalizeFirstLetter(word));
const formattedName = formattedWords.join(' ');

Expand Down
2 changes: 1 addition & 1 deletion src/topicHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function addTopicListeners(){

confirmAddTopicButton_el.addEventListener('click', async () => {
if (topicNameInput_el.value === '') return topicNameInput_el.classList.add('error');
const words = topicNameInput_el.value.split(' ');
const words = topicNameInput_el.value.toLowerCase().split(' ');
const formattedWords = words.map(word => capitalizeFirstLetter(word));
const formattedTopic = formattedWords.join(' ');
const result = await api.topicHandler({request: 'Add', topicName: formattedTopic});
Expand Down

0 comments on commit 0451bbc

Please sign in to comment.