Skip to content

Commit 83a4253

Browse files
committed
Added logging to empty catch block, removed unneeded one
1 parent 9e2136d commit 83a4253

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

chatgpt.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ const chatgpt = {
13681368
notificationDiv.style.right = notificationDiv.isRight ? vpXoffset.toString() + 'px' : ''
13691369
notificationDiv.style.left = !notificationDiv.isRight ? vpXoffset.toString() + 'px' : ''
13701370

1371-
// Reposition old notifications
1371+
// Re-position old notifications
13721372
const thisQuadrantQueue = notifyProps.queue[notificationDiv.quadrant]
13731373
if (thisQuadrantQueue.length > 1) {
13741374
try { // to move old notifications
@@ -1378,7 +1378,7 @@ const chatgpt = {
13781378
vOffset = +parseInt(oldDiv.style[offsetProp]) +5 + oldDiv.getBoundingClientRect().height
13791379
oldDiv.style[offsetProp] = `${ vOffset }px` // change prop
13801380
}
1381-
} catch (err) {}
1381+
} catch (err) { console.warn('Failed to re-position notification:', err) }
13821382
}
13831383

13841384
// Show notification
@@ -1762,8 +1762,7 @@ const chatgpt = {
17621762
activateObserver() {
17631763

17641764
// Stop the previous observer to preserve resources
1765-
if (this.observer instanceof MutationObserver)
1766-
try { this.observer.disconnect() } catch (e) {}
1765+
if (this.observer instanceof MutationObserver) this.observer.disconnect()
17671766

17681767
if (!this.elems.length) return console.error('🤖 chatgpt.js >> No elems to append!')
17691768

0 commit comments

Comments
 (0)