Skip to content

Commit b3e103d

Browse files
committed
Condensed toggles.sidebar.updateAesthetic(), renamed to updateScheme() ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-auto-refresh]
1 parent 3778976 commit b3e103d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 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.29.4
223+
// @version 2025.1.29.5
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
@@ -831,7 +831,7 @@
831831
}
832832

833833
// Update color/state
834-
this.updateAesthetic() ; this.updateState() // to opposite init state for animation on 1st load
834+
this.updateScheme() ; this.updateState() // to opposite init state for animation on 1st load
835835

836836
// Add hover/click listeners
837837
this.div.onmouseover = this.div.onmouseout = event => // trigger OpenAI hover overlay
@@ -909,10 +909,9 @@
909909
sidebar.insertBefore(this.div, sidebar.children[1]) ; this.status = 'inserted'
910910
},
911911

912-
updateAesthetic() { // to match UI scheme
913-
const isDarkScheme = env.ui.scheme == 'dark'
914-
this.div.classList.add(isDarkScheme ? 'dark' : 'light')
915-
this.div.classList.remove(isDarkScheme ? 'light' : 'dark')
912+
updateScheme() { // to match UI scheme
913+
this.div.classList.add(env.ui.scheme)
914+
this.div.classList.remove(env.ui.scheme == 'dark' ? 'light' : 'dark')
916915
this.navicon.src = `${app.urls.assetHost}/images/icons/auto-refresh/${
917916
env.ui.scheme == 'dark' ? 'white' : 'black' }/icon32.png?v=${app.latestResourceCommitHash}`
918917
},
@@ -991,7 +990,7 @@
991990
function handleSchemePrefChange() {
992991
const displayedScheme = getScheme()
993992
if (env.ui.scheme != displayedScheme) {
994-
env.ui.scheme = displayedScheme ; toggles.sidebar.updateAesthetic() ; modals.stylize() }
993+
env.ui.scheme = displayedScheme ; toggles.sidebar.updateScheme() ; modals.stylize() }
995994
}
996995

997996
// Disable distracting SIDEBAR CLICK-ZOOM effect

0 commit comments

Comments
 (0)