Skip to content

Commit 6d3a1a8

Browse files
committed
Refactored clickHandler() event check in chatgpt.alert() for readability ↞ [auto-sync from https://github.com/KudoAI/chatgpt.js]
1 parent 8f13def commit 6d3a1a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

starters/chrome/extension/lib/chatgpt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ const chatgpt = {
229229

230230
// Define click/key handlers
231231
const clickHandler = event => { // explicitly defined to support removal post-dismissal
232-
if (event.target == event.currentTarget || event.target instanceof SVGPathElement) dismissAlert(); };
232+
if (event.target == event.currentTarget || event.target.closest('[class*="-close-btn]')) dismissAlert(); };
233233
const keyHandler = event => { // to dismiss active alert
234234
if (/^(?: |Space|Enter|Return|Esc)/.test(event.key) || [32, 13, 27].includes(event.keyCode)) {
235235
for (const alertId of alertQueue) { // look to handle only if triggering alert is active

starters/chrome/extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "ChatGPT Extension",
44
"short_name": "ChatGPT 🧩",
55
"description": "A Chromium extension template to start using chatgpt.js like a boss!",
6-
"version": "2024.12.19",
6+
"version": "2024.12.20",
77
"author": "KudoAI",
88
"homepage_url": "https://github.com/KudoAI/chatgpt.js-chrome-starter",
99
"icons": {

0 commit comments

Comments
 (0)