Skip to content

Commit

Permalink
Moved settingIsEnabled() into settings ↞ [auto-sync from https://…
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Feb 26, 2025
1 parent 84eb420 commit cd3fa64
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions greasemonkey/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 2025.2.25.2
// @version 2025.2.26
// @license MIT
// @icon https://assets.chatgptautorefresh.com/images/icons/openai/black/icon48.png?v=f11a0a8
// @icon64 https://assets.chatgptautorefresh.com/images/icons/openai/black/icon64.png?v=f11a0a8
Expand Down Expand Up @@ -401,6 +401,8 @@
label: app.msgs.menuLabel_refreshInt, helptip: app.msgs.helptip_refreshInt }
},

isEnabled(key) { return config[key] ^ /disabled/i.test(key) },

load(...keys) {
keys.flat().forEach(key => {
config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`,
Expand Down Expand Up @@ -435,10 +437,10 @@
Object.keys(settings.controls).forEach(key => {
const ctrlType = settings.controls[key].type
const ctrlStatus = settings.controls[key].status
const menuLabel = `${ settings.controls[key].symbol || this.state.symbols[+settingIsEnabled(key)] } `
const menuLabel = `${ settings.controls[key].symbol || this.state.symbols[+settings.isEnabled(key)] } `
+ settings.controls[key].label
+ ( ctrlType == 'toggle' ? this.state.separator
+ this.state.words[+settingIsEnabled(key)]
+ this.state.words[+settings.isEnabled(key)]
: ctrlStatus ? `— ${settings.controls[key].status}` : '' )
this.ids.push(GM_registerMenuCommand(menuLabel, () => {
if (ctrlType == 'toggle') {
Expand Down Expand Up @@ -474,8 +476,6 @@
+ ` ${app.msgs[`menuLabel_${entryType}`]} ${ entryType == 'about' ? app.msgs.appName : '' }`,
() => modals.open(entryType), env.scriptManager.supportsTooltips ? { title: ' ' } : undefined
)))

function settingIsEnabled(key) { return config[key] ^ /disabled/i.test(key) }
}
}

Expand Down

0 comments on commit cd3fa64

Please sign in to comment.