Skip to content

Commit 4b55680

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-refresh]
1 parent e3daf26 commit 4b55680

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chatgpt/chatgpt-auto-refresh/chatgpt-auto-refresh.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
// @description:zu *NGOKUPHEPHA* susa ukusetha kabusha ingxoxo yemizuzu eyi-10 + amaphutha enethiwekhi ahlala njalo + Ukuhlolwa kwe-Cloudflare ku-ChatGPT.
221221
// @author Adam Lui
222222
// @namespace https://github.com/adamlui
223-
// @version 2025.1.12
223+
// @version 2025.1.12.1
224224
// @license MIT
225225
// @icon https://assets.chatgptautorefresh.com/images/icons/openai/black/icon48.png?v=f11a0a8
226226
// @icon64 https://assets.chatgptautorefresh.com/images/icons/openai/black/icon64.png?v=f11a0a8
@@ -534,13 +534,13 @@
534534

535535
open(modalType, modalSubType) {
536536
const modal = modalSubType ? this[modalType][modalSubType]() : this[modalType]() // show modal
537+
if (!modal) return // since no div returned
537538
this.stack.unshift(modalSubType ? `${modalType}_${modalSubType}` : modalType) // add to stack
538539
this.init(modal) // add classes + starry bg
539540
this.observeRemoval(modal, modalType, modalSubType) // to maintain stack for proper nav
540541
},
541542

542543
init(modal) {
543-
if (!modal) return // to support non-div this.open()s
544544
if (!this.styles) this.stylize() // to init/append stylesheet
545545
modal.classList.add('no-user-select', this.class) ; modal.parentNode.classList.add(`${this.class}-bg`)
546546
fillStarryBG(modal) // add starry bg

0 commit comments

Comments
 (0)