Skip to content

Commit

Permalink
Enhanced settings.isEnabled() to handle control labels, expanded in…
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Feb 28, 2025
1 parent 3bfb6eb commit 1c4df2b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 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.28
// @version 2025.2.28.1
// @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,7 +401,12 @@
label: app.msgs.menuLabel_refreshInt, helptip: app.msgs.helptip_refreshInt }
},

isEnabled(key) { return config[key] ^ /disabled/i.test(key) },
isEnabled(key) {
const reInvertFlags = /disabled|hidden/i
return reInvertFlags.test(key) // flag in control key name
&& !reInvertFlags.test(this.controls[key]?.label || '') // but not in label msg key name
? !config[key] : config[key] // so invert since flag reps opposite state, else don't
},

load(...keys) {
keys.flat().forEach(key => {
Expand Down

0 comments on commit 1c4df2b

Please sign in to comment.