Skip to content

Commit

Permalink
Replaced all this.alert() w/ modals.alert() to avoid potential na…
Browse files Browse the repository at this point in the history
…mespace conflicts w/ `window.alert()` ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions]
  • Loading branch information
kudo-sync-bot committed Dec 6, 2024
1 parent 5867276 commit 538c68d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions chrome/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ window.modals = {
function checkForUpdates(){ modals.dependencies.checkForUpdates() })

// Show modal
const aboutModal = this.alert(
const aboutModal = modals.alert(
`${this.dependencies.app.symbol} ${this.getMsg('appName')}`, // title
`<span style="${headingStyle}"><b>🏷️ <i>${this.getMsg('about_version')}</i></b>: </span>`
+ `<span style="${pStyle}">${this.dependencies.app.version}</span>\n`
Expand Down Expand Up @@ -161,7 +161,7 @@ window.modals = {
donate() {

// Show modal
const donateModal = this.alert(
const donateModal = modals.alert(
`💖 ${this.getMsg('alert_showYourSupport')}`, // title
`<p>${this.getMsg('appName')} ${this.getMsg('alert_isOSS')}.</p>`
+ `<p>${this.getMsg('alert_despiteAffliction')} `
Expand Down Expand Up @@ -227,7 +227,7 @@ window.modals = {
: this.env.runtime.includes('Chromium') ? function chromeWebStore(){}
: function greasyFork(){} )
// Show modal
const feedbackModal = this.alert(`${this.getMsg('alert_choosePlatform')}:`, '', modalBtns)
const feedbackModal = modals.alert(`${this.getMsg('alert_choosePlatform')}:`, '', modalBtns)

// Hack buttons
feedbackModal.querySelectorAll('button').forEach((btn, idx) => {
Expand Down
6 changes: 3 additions & 3 deletions firefox/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ window.modals = {
function checkForUpdates(){ modals.dependencies.checkForUpdates() })

// Show modal
const aboutModal = this.alert(
const aboutModal = modals.alert(
`${this.dependencies.app.symbol} ${this.getMsg('appName')}`, // title
`<span style="${headingStyle}"><b>🏷️ <i>${this.getMsg('about_version')}</i></b>: </span>`
+ `<span style="${pStyle}">${this.dependencies.app.version}</span>\n`
Expand Down Expand Up @@ -161,7 +161,7 @@ window.modals = {
donate() {

// Show modal
const donateModal = this.alert(
const donateModal = modals.alert(
`💖 ${this.getMsg('alert_showYourSupport')}`, // title
`<p>${this.getMsg('appName')} ${this.getMsg('alert_isOSS')}.</p>`
+ `<p>${this.getMsg('alert_despiteAffliction')} `
Expand Down Expand Up @@ -227,7 +227,7 @@ window.modals = {
: this.env.runtime.includes('Chromium') ? function chromeWebStore(){}
: function greasyFork(){} )
// Show modal
const feedbackModal = this.alert(`${this.getMsg('alert_choosePlatform')}:`, '', modalBtns)
const feedbackModal = modals.alert(`${this.getMsg('alert_choosePlatform')}:`, '', modalBtns)

// Hack buttons
feedbackModal.querySelectorAll('button').forEach((btn, idx) => {
Expand Down

0 comments on commit 538c68d

Please sign in to comment.