Skip to content

Commit

Permalink
Replaced .addEventListener() w/ .onclick against "best" practices…
Browse files Browse the repository at this point in the history
… since it shortens codebase + widens browser compatibility
  • Loading branch information
adamlui committed Jun 24, 2024
1 parent f3744a8 commit 3c6972d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chatgpt/chatgpt-auto-refresh/chatgpt-auto-refresh.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
// @description:zu *NGOKUPHEPHA* susa ukusetha kabusha ingxoxo yemizuzu eyi-10 + amaphutha enethiwekhi ahlala njalo + Ukuhlolwa kwe-Cloudflare ku-ChatGPT.
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.6.20
// @version 2024.6.24
// @license MIT
// @match *://chatgpt.com/*
// @match *://chat.openai.com/*
Expand Down Expand Up @@ -366,7 +366,7 @@
insertToggle()

// Add LISTENER to toggle switch/label/config/menu/auto-refresh
navToggleDiv.addEventListener('click', () => {
navToggleDiv.onclick = () => {
const toggleInput = document.getElementById('arToggleInput')
toggleInput.checked = !toggleInput.checked ; config.arDisabled = !toggleInput.checked
updateToggleHTML() ; refreshMenu()
Expand All @@ -377,7 +377,7 @@
chatgpt.autoRefresh.deactivate()
if (!config.notifDisabled) notify(( msgs.menuLabel_autoRefresh || 'Auto-Refresh' ) + ': OFF')
} saveSetting('arDisabled', config.arDisabled)
})
}

// Monitor <html> to maintain SIDEBAR TOGGLE VISIBILITY on node changes
const nodeObserver = new MutationObserver(mutations => { mutations.forEach(mutation => {
Expand Down

0 comments on commit 3c6972d

Please sign in to comment.