Skip to content

Commit

Permalink
Updated chatgpt.getNewChatButton() to work in Logged Out session
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui authored Sep 12, 2024
1 parent 0353a38 commit 93e6829
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,10 +891,8 @@ const chatgpt = { // eslint-disable-line no-redeclare
getLastResponse() { return chatgpt.getChatData('active', 'msg', 'chatgpt', 'latest'); },

getNewChatButton() {
for (const navBtnSVG of document.querySelectorAll('nav button svg'))
if (navBtnSVG.querySelector('path[d^="M15.6729"], ' // pencil-on-pad icon
+ 'path[d^="M3.06957"]')) // refresh icon if temp chat
return navBtnSVG.parentNode;
return document.querySelector('button:has([d*="M15.6729"],' // pencil-on-pad icon
+ '[d^="M3.06957"])'); // refresh icon if temp chat
},

getNewChatLink() { return document.querySelector('nav a[href="/"]'); },
Expand Down

0 comments on commit 93e6829

Please sign in to comment.