Skip to content

Commit 11e38de

Browse files
committed
Moved settingIsEnabled() into settings ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-auto-refresh]
1 parent 4d6c04e commit 11e38de

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 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.2.25.2
223+
// @version 2025.2.26
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
@@ -401,6 +401,8 @@
401401
label: app.msgs.menuLabel_refreshInt, helptip: app.msgs.helptip_refreshInt }
402402
},
403403

404+
isEnabled(key) { return config[key] ^ /disabled/i.test(key) },
405+
404406
load(...keys) {
405407
keys.flat().forEach(key => {
406408
config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`,
@@ -435,10 +437,10 @@
435437
Object.keys(settings.controls).forEach(key => {
436438
const ctrlType = settings.controls[key].type
437439
const ctrlStatus = settings.controls[key].status
438-
const menuLabel = `${ settings.controls[key].symbol || this.state.symbols[+settingIsEnabled(key)] } `
440+
const menuLabel = `${ settings.controls[key].symbol || this.state.symbols[+settings.isEnabled(key)] } `
439441
+ settings.controls[key].label
440442
+ ( ctrlType == 'toggle' ? this.state.separator
441-
+ this.state.words[+settingIsEnabled(key)]
443+
+ this.state.words[+settings.isEnabled(key)]
442444
: ctrlStatus ? `— ${settings.controls[key].status}` : '' )
443445
this.ids.push(GM_registerMenuCommand(menuLabel, () => {
444446
if (ctrlType == 'toggle') {
@@ -474,8 +476,6 @@
474476
+ ` ${app.msgs[`menuLabel_${entryType}`]} ${ entryType == 'about' ? app.msgs.appName : '' }`,
475477
() => modals.open(entryType), env.scriptManager.supportsTooltips ? { title: ' ' } : undefined
476478
)))
477-
478-
function settingIsEnabled(key) { return config[key] ^ /disabled/i.test(key) }
479479
}
480480
}
481481

0 commit comments

Comments
 (0)