Skip to content

Commit

Permalink
Replaced let w/ const where applicable for code clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Aug 29, 2024
1 parent 714c135 commit ada38b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions starters/chrome/extension/lib/chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ const chatgpt = { // eslint-disable-line no-redeclare
if (chatDivs.length === 0) return console.error('Chat is empty!');
const msgs = []; let isUserMsg = true;
chatDivs.forEach((div) => {
const sender = isUserMsg ? 'USER' : 'CHATGPT'; isUserMsg = !isUserMsg;
let msg = Array.from(div.childNodes).map(node => node.innerText)
.join('\n\n') // insert double line breaks between paragraphs
.replace('Copy code', '');
const sender = isUserMsg ? 'USER' : 'CHATGPT'; isUserMsg = !isUserMsg,
msg = Array.from(div.childNodes).map(node => node.innerText)
.join('\n\n') // insert double line breaks between paragraphs
.replace('Copy code', '');
msgs.push(sender + ': ' + msg);
});
transcript = msgs.join('\n\n');
Expand Down Expand Up @@ -1136,7 +1136,7 @@ const chatgpt = { // eslint-disable-line no-redeclare
const optionButtons = document.querySelectorAll('a[role="menuitem"]');
let cssClasses;

for (let navLink of optionButtons)
for (const navLink of optionButtons)
if (navLink.textContent == 'Settings') {
cssClasses = navLink.classList;
break; }
Expand Down

0 comments on commit ada38b9

Please sign in to comment.