|
220 | 220 | // @description:zu *NGOKUPHEPHA* susa ukusetha kabusha ingxoxo yemizuzu eyi-10 + amaphutha enethiwekhi ahlala njalo + Ukuhlolwa kwe-Cloudflare ku-ChatGPT.
|
221 | 221 | // @author Adam Lui
|
222 | 222 | // @namespace https://github.com/adamlui
|
223 |
| -// @version 2025.1.10.1 |
| 223 | +// @version 2025.1.11 |
224 | 224 | // @license MIT
|
225 | 225 | // @icon https://assets.chatgptautorefresh.com/images/icons/openai/black/icon48.png?v=f11a0a8
|
226 | 226 | // @icon64 https://assets.chatgptautorefresh.com/images/icons/openai/black/icon64.png?v=f11a0a8
|
|
390 | 390 | const settings = {
|
391 | 391 |
|
392 | 392 | controls: { // displays top-to-bottom in toolbar menu
|
393 |
| - arDisabled: { type: 'toggle', |
| 393 | + arDisabled: { type: 'toggle', defaultVal: false, |
394 | 394 | label: app.msgs.menuLabel_autoRefresh },
|
395 |
| - toggleHidden: { type: 'toggle', |
| 395 | + toggleHidden: { type: 'toggle', defaultVal: false, |
396 | 396 | label: app.msgs.menuLabel_toggleVis, helptip: app.msgs.helptip_toggleVis },
|
397 |
| - notifDisabled: { type: 'toggle', |
| 397 | + notifDisabled: { type: 'toggle', defaultVal: false, |
398 | 398 | label: app.msgs.menuLabel_modeNotifs, helptip: app.msgs.helptip_modeNotifs },
|
399 | 399 | refreshInterval: { type: 'prompt', symbol: '⌚',
|
400 | 400 | label: app.msgs.menuLabel_refreshInt, helptip: app.msgs.helptip_refreshInt }
|
401 | 401 | },
|
402 | 402 |
|
403 |
| - load(...keys) { keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, false)) }, |
| 403 | + load(...keys) { |
| 404 | + keys.flat().forEach(key => { |
| 405 | + config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, |
| 406 | + this.controls[key]?.defaultVal || this.controls[key]?.type == 'toggle') |
| 407 | + }) |
| 408 | + }, |
| 409 | + |
404 | 410 | save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; config[key] = val }
|
405 | 411 | }
|
406 | 412 | settings.load(Object.keys(settings.controls))
|
|
0 commit comments