Skip to content

Commit

Permalink
Condensed chatgpt.history.isLoaded() using IIFE
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed May 16, 2024
1 parent f15a704 commit 47b6b87
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,11 +905,10 @@ const chatgpt = { // eslint-disable-line no-redeclare
history: {
isLoaded: function() {
return new Promise(resolve => {
const checkChatHistory = () => {
(function checkChatHistory() {
if (document.querySelector('nav')) resolve(true);
else setTimeout(checkChatHistory, 100);
};
checkChatHistory();
})();
});}
},

Expand Down

0 comments on commit 47b6b87

Please sign in to comment.