Skip to content

Commit 19fbf8d

Browse files
committed
Deleted window.config init, added app.config init to settings.<load|save>() ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/amazongpt]
1 parent 2699140 commit 19fbf8d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

chatgpt/amazongpt/amazongpt.user.js

Lines changed: 4 additions & 2 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.3
6+
// @version 2026.1.26.4
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
@@ -214,6 +214,7 @@
214214
// Init SETTINGS
215215
window.settings = {
216216
load(...keys) {
217+
app.config ??= {}
217218
keys.flat().forEach(key =>
218219
app.config[key] = processKey(key, GM_getValue(`${app.configKeyPrefix}_${key}`, undefined)))
219220
function processKey(key, val) {
@@ -225,7 +226,8 @@
225226
return val ?? (ctrl?.defaultVal ?? (ctrl?.type == 'slider' ? 100 : false))
226227
}
227228
},
228-
save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; app.config[key] = val },
229+
save(key, val) {
230+
app.config ??= {} ; GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; app.config[key] = val },
229231
typeIsEnabled(key) {
230232
const reInvertFlags = /disabled|hidden/i
231233
return reInvertFlags.test(key) // flag in control key name

0 commit comments

Comments
 (0)