Skip to content

Commit 9aac279

Browse files
committed
Moved non-div check from modals.init() to .open() to support .observeRemoval() too ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-auto-talk]
1 parent d5d2429 commit 9aac279

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chatgpt/chatgpt-auto-talk/chatgpt-auto-talk.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
// @description:zu Dlala izimpendulo ze-ChatGPT ngokuzenzakalela
226226
// @author Adam Lui
227227
// @namespace https://github.com/adamlui
228-
// @version 2025.1.12
228+
// @version 2025.1.12.1
229229
// @license MIT
230230
// @icon https://assets.chatgptautotalk.com/images/icons/openai/black/icon48.png?v=9f1ed3c
231231
// @icon64 https://assets.chatgptautotalk.com/images/icons/openai/black/icon64.png?v=9f1ed3c
@@ -485,13 +485,13 @@
485485

486486
open(modalType, modalSubType) {
487487
const modal = modalSubType ? this[modalType][modalSubType]() : this[modalType]() // show modal
488+
if (!modal) return // since no div returned
488489
this.stack.unshift(modalSubType ? `${modalType}_${modalSubType}` : modalType) // add to stack
489490
this.init(modal) // add classes + starry bg
490491
this.observeRemoval(modal, modalType, modalSubType) // to maintain stack for proper nav
491492
},
492493

493494
init(modal) {
494-
if (!modal) return // to support non-div this.open()s
495495
if (!this.styles) this.stylize() // to init/append stylesheet
496496
modal.classList.add('no-user-select', this.class) ; modal.parentNode.classList.add(`${this.class}-bg`)
497497
fillStarryBG(modal) // add starry bg

0 commit comments

Comments
 (0)