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/googlegpt]
  • Loading branch information
kudo-sync-bot committed Jan 16, 2025
1 parent 6fd475e commit 2fe425c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions greasemonkey/googlegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2025.1.15.10
// @version 2025.1.15.11
// @license MIT
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
Expand Down Expand Up @@ -3058,7 +3058,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 2fe425c

Please sign in to comment.