Skip to content

Commit 0451bbc

Browse files
Consistency Fix
- 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
1 parent f529a8c commit 0451bbc

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/subtopicHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function addSubtopicListeners(){
2626

2727
confirmAddSubtopicButton_el.addEventListener('click', async () => {
2828
if (subtopicNameInput_el.value === '') return subtopicNameInput_el.classList.add('error');
29-
const words = subtopicNameInput_el.value.split(' ');
29+
const words = subtopicNameInput_el.value.toLowerCase().split(' ');
3030
const formattedWords = words.map(word => capitalizeFirstLetter(word));
3131
const formattedTopic = formattedWords.join(' ');
3232
const result = await api.subtopicHandler({request: 'Add', topicID: topicNameSelect_el.value, subtopicName: formattedTopic});

src/timer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function formatTime(milliseconds){
6868
};
6969

7070
async function logTimeHandler(time){
71-
const words = projectInput_el.value.split(' ');
71+
const words = projectInput_el.value.toLowerCase().split(' ');
7272
const formattedWords = words.map(word => capitalizeFirstLetter(word));
7373
const formattedName = formattedWords.join(' ');
7474

src/topicHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function addTopicListeners(){
1616

1717
confirmAddTopicButton_el.addEventListener('click', async () => {
1818
if (topicNameInput_el.value === '') return topicNameInput_el.classList.add('error');
19-
const words = topicNameInput_el.value.split(' ');
19+
const words = topicNameInput_el.value.toLowerCase().split(' ');
2020
const formattedWords = words.map(word => capitalizeFirstLetter(word));
2121
const formattedTopic = formattedWords.join(' ');
2222
const result = await api.topicHandler({request: 'Add', topicName: formattedTopic});

0 commit comments

Comments
 (0)