Skip to content

Commit 24d157a

Browse files
committed
Moved dom.fillStarryBG() from open() to init() + added init() to alert() for more logical flow ↞ [auto-sync from https://github.com/KudoAI/chatgpt.js-chrome-starter]
1 parent 0a4f19b commit 24d157a

File tree

1 file changed

+2
-2
lines changed
  • starters/chrome/extension/components

1 file changed

+2
-2
lines changed

starters/chrome/extension/components/modals.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ window.modals = {
1212
alert(title = '', msg = '', btns = '', checkbox = '', width = '') {
1313
const alertID = chatgpt.alert(title, msg, btns, checkbox, width),
1414
alert = document.getElementById(alertID).firstChild
15-
this.init(alert) // add class
1615
return alert
1716
},
1817

@@ -21,13 +20,14 @@ window.modals = {
2120
const modal = this[modalType]() // show modal
2221
modal.classList.add('chatgpt-infinity-modal')
2322
modal.onmousedown = this.dragHandlers.mousedown
24-
dom.fillStarryBG(modal) // fill BG w/ rising stars
23+
this.init(alert) // add class/starry bg
2524
this.observeRemoval(modal, modalType) // to maintain stack for proper nav
2625
},
2726

2827
init(modal) {
2928
if (!this.styles) this.stylize() // to init/append stylesheet
3029
modal.classList.add(this.class) ; modal.parentNode.classList.add(`${this.class}-bg`) // add classes
30+
dom.fillStarryBG(modal) // add Rising Stars bg
3131
},
3232

3333
stylize() {

0 commit comments

Comments
 (0)