Skip to content

Commit db5014c

Browse files
committed
Grouped ternary in initDefaultVal() for desired precedence
1 parent 619c6a9 commit db5014c

File tree

13 files changed

+25
-38
lines changed

13 files changed

+25
-38
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 2 additions & 3 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 2025.5.26.5
6+
// @version 2025.5.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
@@ -218,8 +218,7 @@
218218
keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, initDefaultVal(key)))
219219
function initDefaultVal(key) {
220220
return this.controls?.[key]?.defaultVal
221-
?? this.controls?.[key]?.type == 'slider' ? 100
222-
: this.controls?.[key]?.type == 'toggle'
221+
?? ( this.controls?.[key]?.type == 'slider' ? 100 : this.controls?.[key]?.type == 'toggle' )
223222
}
224223
},
225224
save(key, val) { GM_setValue(`${app.configKeyPrefix}_${key}`, val) ; config[key] = val }

autoclear-chatgpt-history/greasemonkey/autoclear-chatgpt-history.user.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
226226
// @author Adam Lui
227227
// @namespace https://github.com/adamlui
228-
// @version 2025.5.26.2
228+
// @version 2025.5.26.3
229229
// @license MIT
230230
// @icon https://assets.autoclearchatgpt.com/images/icons/openai/black/icon48.png?v=f461c06
231231
// @icon64 https://assets.autoclearchatgpt.com/images/icons/openai/black/icon64.png?v=f461c06
@@ -344,8 +344,7 @@
344344
keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, initDefaultVal(key)))
345345
function initDefaultVal(key) {
346346
return this.controls?.[key]?.defaultVal
347-
?? this.controls?.[key]?.type == 'slider' ? 100
348-
: this.controls?.[key]?.type == 'toggle'
347+
?? ( this.controls?.[key]?.type == 'slider' ? 100 : this.controls?.[key]?.type == 'toggle' )
349348
}
350349
},
351350

bravegpt/greasemonkey/bravegpt.user.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.5.26.5
151+
// @version 2025.5.26.6
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/app/icon48.png?v=e8ca7c2
154154
// @icon64 https://assets.bravegpt.com/images/icons/app/icon64.png?v=e8ca7c2
@@ -341,8 +341,7 @@
341341
keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, initDefaultVal(key)))
342342
function initDefaultVal(key) {
343343
return this.controls?.[key]?.defaultVal
344-
?? this.controls?.[key]?.type == 'slider' ? 100
345-
: this.controls?.[key]?.type == 'toggle'
344+
?? ( this.controls?.[key]?.type == 'slider' ? 100 : this.controls?.[key]?.type == 'toggle' )
346345
}
347346
},
348347

chatgpt-auto-continue/chromium/extension/lib/settings.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ window.settings = {
5757
config[key] = (await chrome.storage.local.get(key))[key] ?? initDefaultVal(key)))
5858
function initDefaultVal(key) {
5959
return this.controls?.[key]?.defaultVal
60-
?? this.controls?.[key]?.type == 'slider' ? 100
61-
: this.controls?.[key]?.type == 'toggle'
60+
?? ( this.controls?.[key]?.type == 'slider' ? 100 : this.controls?.[key]?.type == 'toggle' )
6261
}
6362
},
6463

chatgpt-auto-continue/firefox/extension/lib/settings.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ window.settings = {
5656
return Promise.all(keys.map(async key => // resolve promise when all keys load
5757
config[key] = (await chrome.storage.local.get(key))[key] ?? initDefaultVal(key)))
5858
function initDefaultVal(key) {
59-
return this.controls?.[key]?.defaultVal
60-
?? this.controls?.[key]?.type == 'slider' ? 100
61-
: this.controls?.[key]?.type == 'toggle'
59+
return this.controls?.[key]?.defaultVal ?? (
60+
this.controls?.[key]?.type == 'slider' ? 100 : this.controls?.[key]?.type == 'toggle' )
6261
}
6362
},
6463

chatgpt-auto-refresh/greasemonkey/chatgpt-auto-refresh.user.js

Lines changed: 2 additions & 3 deletions
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.5.26.2
223+
// @version 2025.5.26.3
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
@@ -343,8 +343,7 @@
343343
keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, initDefaultVal(key)))
344344
function initDefaultVal(key) {
345345
return this.controls?.[key]?.defaultVal
346-
?? this.controls?.[key]?.type == 'slider' ? 100
347-
: this.controls?.[key]?.type == 'toggle'
346+
?? ( this.controls?.[key]?.type == 'slider' ? 100 : this.controls?.[key]?.type == 'toggle' )
348347
}
349348
},
350349

chatgpt-auto-talk/greasemonkey/chatgpt-auto-talk.user.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
// @description:zu Dlala izimpendulo ze-ChatGPT ngokuzenzakalela
226226
// @author Adam Lui
227227
// @namespace https://github.com/adamlui
228-
// @version 2025.5.26.2
228+
// @version 2025.5.26.3
229229
// @license MIT
230230
// @icon https://assets.chatgptautotalk.com/images/icons/openai/black/icon48.png?v=9f1ed3c
231231
// @icon64 https://assets.chatgptautotalk.com/images/icons/openai/black/icon64.png?v=9f1ed3c
@@ -332,8 +332,7 @@
332332
keys.flat().forEach(key => config[key] = GM_getValue(`${app.configKeyPrefix}_${key}`, initDefaultVal(key)))
333333
function initDefaultVal(key) {
334334
return this.controls?.[key]?.defaultVal
335-
?? this.controls?.[key]?.type == 'slider' ? 100
336-
: this.controls?.[key]?.type == 'toggle'
335+
?? ( this.controls?.[key]?.type == 'slider' ? 100 : this.controls?.[key]?.type == 'toggle' )
337336
}
338337
},
339338

chatgpt-infinity/chromium/extension/lib/settings.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ window.settings = {
8585
return Promise.all(keys.map(async key => // resolve promise when all keys load
8686
config[key] = (await chrome.storage.local.get(key))[key] ?? initDefaultVal(key)))
8787
function initDefaultVal(key) {
88-
return this.controls?.[key]?.defaultVal
89-
?? this.controls?.[key]?.type == 'slider' ? 100
90-
: this.controls?.[key]?.type == 'toggle'
88+
return this.controls?.[key]?.defaultVal ?? (
89+
this.controls?.[key]?.type == 'slider' ? 100 : this.controls?.[key]?.type == 'toggle' )
9190
}
9291
},
9392

chatgpt-infinity/firefox/extension/lib/settings.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ window.settings = {
8585
return Promise.all(keys.map(async key => // resolve promise when all keys load
8686
config[key] = (await chrome.storage.local.get(key))[key] ?? initDefaultVal(key)))
8787
function initDefaultVal(key) {
88-
return this.controls?.[key]?.defaultVal
89-
?? this.controls?.[key]?.type == 'slider' ? 100
90-
: this.controls?.[key]?.type == 'toggle'
88+
return this.controls?.[key]?.defaultVal ?? (
89+
this.controls?.[key]?.type == 'slider' ? 100 : this.controls?.[key]?.type == 'toggle' )
9190
}
9291
},
9392

chatgpt-widescreen/chromium/extension/lib/settings.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ window.settings = {
142142
config[key] = result[`${env.site}_${key}`] ?? result[key] ?? initDefaultVal(key)
143143
}))
144144
function initDefaultVal(key) {
145-
return this.controls?.[key]?.defaultVal
146-
?? this.controls?.[key]?.type == 'slider' ? 100
147-
: this.controls?.[key]?.type == 'toggle'
145+
return this.controls?.[key]?.defaultVal ?? (
146+
this.controls?.[key]?.type == 'slider' ? 100 : this.controls?.[key]?.type == 'toggle' )
148147
}
149148
},
150149

0 commit comments

Comments
 (0)