Skip to content

Commit dd79d44

Browse files
committed
Moved app.config init out of settings ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/duckduckgpt]
1 parent e2545a0 commit dd79d44

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

chatgpt/duckduckgpt/duckduckgpt.user.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2026.1.26.4
151+
// @version 2026.1.26.5
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/app/icon48.png?v=533ce0f
154154
// @icon64 https://assets.ddgpt.com/images/icons/app/icon64.png?v=533ce0f
@@ -338,9 +338,9 @@
338338
apis.AIchatOS.userID = '#/chat/' + Date.now()
339339

340340
// Init SETTINGS
341+
app.config ??= {}
341342
window.settings = {
342343
load(...keys) {
343-
app.config ??= {}
344344
keys.flat().forEach(key =>
345345
app.config[key] = processKey(key, GM_getValue(`${app.configKeyPrefix}_${key}`, undefined)))
346346
function processKey(key, val) {
@@ -352,8 +352,7 @@
352352
return val ?? (ctrl?.defaultVal ?? (ctrl?.type == 'slider' ? 100 : false))
353353
}
354354
},
355-
save(key, val) {
356-
app.config ??= {} ; GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; app.config[key] = val },
355+
save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; app.config[key] = val },
357356
typeIsEnabled(key) {
358357
const reInvertFlags = /disabled|hidden/i
359358
return reInvertFlags.test(key) // flag in control key name

0 commit comments

Comments
 (0)