mirror of
https://github.com/f/awesome-chatgpt-prompts.git
synced 2026-04-18 12:10:11 +00:00
Merge pull request #1122 from murataslan1/fix/cli-missing-full-content-param
fix(cli): add missing full_content param to API URL
This commit is contained in:
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
||||
import { homedir } from 'os';
|
||||
import { join } from 'path';
|
||||
|
||||
const PROMPTS_URL = 'https://prompts.chat/prompts.json';
|
||||
const PROMPTS_URL = 'https://prompts.chat/prompts.json?full_content=true';
|
||||
const CACHE_DIR = join(homedir(), '.prompts-chat');
|
||||
const CACHE_FILE = join(CACHE_DIR, 'prompts.json');
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ export function PromptDetail({ prompt, onBack, onCopy }: PromptDetailProps) {
|
||||
const contentHeight = Math.max(terminalHeight - headerLines - footerLines, 5);
|
||||
|
||||
useEffect(() => {
|
||||
const vars = extractVariables(prompt.content);
|
||||
const vars = extractVariables(prompt.content ?? '');
|
||||
setVariables(vars);
|
||||
|
||||
const defaults: Record<string, string> = {};
|
||||
@@ -90,7 +90,7 @@ export function PromptDetail({ prompt, onBack, onCopy }: PromptDetailProps) {
|
||||
const contentLines = useMemo(() => {
|
||||
if (!prompt) return [];
|
||||
// Parse escape sequences like \n
|
||||
const parsedContent = prompt.content.replace(/\\n/g, '\n');
|
||||
const parsedContent = (prompt.content ?? '').replace(/\\n/g, '\n');
|
||||
return wrapText(parsedContent, terminalWidth - 6);
|
||||
}, [prompt, terminalWidth]);
|
||||
|
||||
@@ -200,12 +200,12 @@ export function PromptDetail({ prompt, onBack, onCopy }: PromptDetailProps) {
|
||||
setCurrentVarIndex(0);
|
||||
setCurrentInput(variableValues[variables[0].name] || '');
|
||||
} else {
|
||||
handleCopy(prompt.content);
|
||||
handleCopy(prompt.content ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
if (input === 'C' && prompt) {
|
||||
handleCopy(prompt.content);
|
||||
handleCopy(prompt.content ?? '');
|
||||
}
|
||||
|
||||
if (input === 'o' && prompt) {
|
||||
|
||||
Reference in New Issue
Block a user