Skip to content

Commit b5c3966

Browse files
committed
Restricted API fallback from DOM method in chatgpt.clearChats() to only when no args passed
1 parent 5117638 commit b5c3966

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

chatgpt.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,9 @@ const chatgpt = { // eslint-disable-line no-redeclare
398398
document.querySelector('button[class*="danger"').click(); // confirm clear
399399
return console.info('Chats successfully cleared.');
400400
} catch (err) {
401-
console.error(err.message); console.info('Using backend API method instead.');
402-
this.clearChats('api');
401+
console.error(err.message);
402+
if (arguments.length == 0) {
403+
console.info('Using backend API method instead.'); this.clearChats('api'); }
403404
}
404405

405406
} else { // API method

0 commit comments

Comments
 (0)