Skip to content

Commit

Permalink
Added modsToApply fallback to prompts.create() for graceful handl…
Browse files Browse the repository at this point in the history
…ing of modless prompts ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/duckduckgpt]
  • Loading branch information
kudo-sync-bot committed Jan 16, 2025
1 parent c742a40 commit 3068d3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chatgpt/duckduckgpt/duckduckgpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2025.1.15.13
// @version 2025.1.15.14
// @license MIT
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
Expand Down Expand Up @@ -2730,7 +2730,7 @@

create({ type, prevQuery }) {
const promptSrc = this[type],
modsToApply = promptSrc.mods?.flatMap(mod => typeof mod == 'string' ? mod : mod.mods)
modsToApply = promptSrc.mods?.flatMap(mod => typeof mod == 'string' ? mod : mod.mods) || []
let builtPrompt = `${promptSrc.base} ${modsToApply?.join(' ')}`.trim()
if (prevQuery) builtPrompt = builtPrompt.replace('${prevQuery}', prevQuery)
return builtPrompt
Expand Down

0 comments on commit 3068d3c

Please sign in to comment.