Skip to content

Commit

Permalink
Updated chatgpt.sidebar.isOn() to work w/ GPT-4o UI
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui authored May 16, 2024
1 parent 10c03ce commit fa6f20b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1747,9 +1747,10 @@ const chatgpt = { // eslint-disable-line no-redeclare
show: function() { this.isOff() ? this.toggle() : console.info('Sidebar already shown!'); },
isOff: function() { return !this.isOn(); },
isOn: function() {
const sidebar = document.querySelector('#__next > div > div');
return chatgpt.browser.isMobile() ?
document.documentElement.style.overflow == 'hidden'
: document.querySelector('#__next > div > div').style.visibility != 'hidden';
: sidebar.style.visibility != 'hidden' && sidebar.style.width != '0px';
},

toggle: function() {
Expand Down

0 comments on commit fa6f20b

Please sign in to comment.