Skip to content

Commit fa89df6

Browse files
committed
Shortened controlType to ctrlType, added ctrlStatus check before appending to label ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-auto-refresh]
1 parent f563875 commit fa89df6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

greasemonkey/chatgpt-auto-refresh.user.js

+7-6
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.21
223+
// @version 2025.2.21.1
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
@@ -434,14 +434,15 @@
434434

435435
// Add toggles
436436
Object.keys(settings.controls).forEach(key => {
437-
const controlType = settings.controls[key].type
437+
const ctrlType = settings.controls[key].type
438+
const ctrlStatus = settings.controls[key].status
438439
const menuLabel = `${ settings.controls[key].symbol || this.state.symbols[+settingIsEnabled(key)] } `
439440
+ settings.controls[key].label
440-
+ ( controlType == 'toggle' ? this.state.separator
441-
+ this.state.words[+settingIsEnabled(key)]
442-
: `— ${settings.controls[key].status}` )
441+
+ ( ctrlType == 'toggle' ? this.state.separator
442+
+ this.state.words[+settingIsEnabled(key)]
443+
: ctrlStatus ? `— ${settings.controls[key].status}` : '' )
443444
this.ids.push(GM_registerMenuCommand(menuLabel, () => {
444-
if (controlType == 'toggle') {
445+
if (ctrlType == 'toggle') {
445446
settings.save(key, !config[key])
446447
notify(`${settings.controls[key].label}: ${
447448
this.state.words[+(config[key] ^ /disabled|hidden/i.test(key))]}`)

0 commit comments

Comments
 (0)