diff options
| author | Adam <[email protected]> | 2026-01-20 10:43:43 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-01-20 17:58:06 -0600 |
| commit | 0f2e8ea2b49fcab8c539449b51c40eea8215c2d3 (patch) | |
| tree | abdad87b9bb3e608d74c6ab478bf76a50b0f6cce /packages/app/src/utils | |
| parent | be493e8be045f25f38e619b79730f437839752a8 (diff) | |
| download | opencode-0f2e8ea2b49fcab8c539449b51c40eea8215c2d3.tar.gz opencode-0f2e8ea2b49fcab8c539449b51c40eea8215c2d3.zip | |
wip(app): i18n
Diffstat (limited to 'packages/app/src/utils')
| -rw-r--r-- | packages/app/src/utils/prompt.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/app/src/utils/prompt.ts b/packages/app/src/utils/prompt.ts index 5d9edfed1..35aec0071 100644 --- a/packages/app/src/utils/prompt.ts +++ b/packages/app/src/utils/prompt.ts @@ -53,10 +53,11 @@ function textPartValue(parts: Part[]) { * Extract prompt content from message parts for restoring into the prompt input. * This is used by undo to restore the original user prompt. */ -export function extractPromptFromParts(parts: Part[], opts?: { directory?: string }): Prompt { +export function extractPromptFromParts(parts: Part[], opts?: { directory?: string; attachmentName?: string }): Prompt { const textPart = textPartValue(parts) const text = textPart?.text ?? "" const directory = opts?.directory + const attachmentName = opts?.attachmentName ?? "attachment" const toRelative = (path: string) => { if (!directory) return path @@ -104,7 +105,7 @@ export function extractPromptFromParts(parts: Part[], opts?: { directory?: strin images.push({ type: "image", id: filePart.id, - filename: filePart.filename ?? "attachment", + filename: filePart.filename ?? attachmentName, mime: filePart.mime, dataUrl: filePart.url, }) |
