Skip to content

Commit 2771225

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

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

chatgpt/amazongpt/amazongpt.user.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Add AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs like GPT-4o!
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2026.1.26.5
6+
// @version 2026.1.26.6
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon48.png?v=8e8ed1c
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon64.png?v=8e8ed1c
@@ -212,9 +212,9 @@
212212
apis.AIchatOS.userID = '#/chat/' + Date.now()
213213

214214
// Init SETTINGS
215+
app.config ??= {}
215216
window.settings = {
216217
load(...keys) {
217-
app.config ??= {}
218218
keys.flat().forEach(key =>
219219
app.config[key] = processKey(key, GM_getValue(`${app.configKeyPrefix}_${key}`, undefined)))
220220
function processKey(key, val) {
@@ -226,8 +226,7 @@
226226
return val ?? (ctrl?.defaultVal ?? (ctrl?.type == 'slider' ? 100 : false))
227227
}
228228
},
229-
save(key, val) {
230-
app.config ??= {} ; GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; app.config[key] = val },
229+
save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; app.config[key] = val },
231230
typeIsEnabled(key) {
232231
const reInvertFlags = /disabled|hidden/i
233232
return reInvertFlags.test(key) // flag in control key name

0 commit comments

Comments
 (0)