Skip to content

Commit 79e98f4

Browse files
committed
Added modsToApply fallback to prompts.create() for graceful handling of modless prompts
1 parent a85abf6 commit 79e98f4

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Adds the magic of AI to Amazon shopping
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.1.15.12
6+
// @version 2025.1.15.13
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
@@ -2282,7 +2282,7 @@
22822282

22832283
create({ type }) {
22842284
const promptSrc = this[type],
2285-
modsToApply = promptSrc.mods?.flatMap(mod => typeof mod == 'string' ? mod : mod.mods)
2285+
modsToApply = promptSrc.mods?.flatMap(mod => typeof mod == 'string' ? mod : mod.mods) || []
22862286
return `${promptSrc.base} ${modsToApply?.join(' ')}`.trim()
22872287
},
22882288

bravegpt/greasemonkey/bravegpt.user.js

Lines changed: 2 additions & 2 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.1.15.11
151+
// @version 2025.1.15.12
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
154154
// @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
@@ -2844,7 +2844,7 @@
28442844

28452845
create({ type, prevQuery }) {
28462846
const promptSrc = this[type],
2847-
modsToApply = promptSrc.mods?.flatMap(mod => typeof mod == 'string' ? mod : mod.mods)
2847+
modsToApply = promptSrc.mods?.flatMap(mod => typeof mod == 'string' ? mod : mod.mods) || []
28482848
let builtPrompt = `${promptSrc.base} ${modsToApply?.join(' ')}`.trim()
28492849
if (prevQuery) builtPrompt = builtPrompt.replace('${prevQuery}', prevQuery)
28502850
return builtPrompt

duckduckgpt/greasemonkey/duckduckgpt.user.js

Lines changed: 2 additions & 2 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 2025.1.15.13
151+
// @version 2025.1.15.14
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
154154
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
@@ -2730,7 +2730,7 @@
27302730

27312731
create({ type, prevQuery }) {
27322732
const promptSrc = this[type],
2733-
modsToApply = promptSrc.mods?.flatMap(mod => typeof mod == 'string' ? mod : mod.mods)
2733+
modsToApply = promptSrc.mods?.flatMap(mod => typeof mod == 'string' ? mod : mod.mods) || []
27342734
let builtPrompt = `${promptSrc.base} ${modsToApply?.join(' ')}`.trim()
27352735
if (prevQuery) builtPrompt = builtPrompt.replace('${prevQuery}', prevQuery)
27362736
return builtPrompt

googlegpt/greasemonkey/googlegpt.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
150150
// @author KudoAI
151151
// @namespace https://kudoai.com
152-
// @version 2025.1.15.10
152+
// @version 2025.1.15.11
153153
// @license MIT
154154
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
155155
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
@@ -3058,7 +3058,7 @@
30583058

30593059
create({ type, prevQuery }) {
30603060
const promptSrc = this[type],
3061-
modsToApply = promptSrc.mods?.flatMap(mod => typeof mod == 'string' ? mod : mod.mods)
3061+
modsToApply = promptSrc.mods?.flatMap(mod => typeof mod == 'string' ? mod : mod.mods) || []
30623062
let builtPrompt = `${promptSrc.base} ${modsToApply?.join(' ')}`.trim()
30633063
if (prevQuery) builtPrompt = builtPrompt.replace('${prevQuery}', prevQuery)
30643064
return builtPrompt

0 commit comments

Comments
 (0)