MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / handleFilenameSubmit

Function handleFilenameSubmit

src/components/ExportDialog.tsx:46–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 };
45
46 const handleFilenameSubmit = () => {
47 const finalFilename = filename.endsWith('.txt') ? filename : filename.replace(/\.[^.]+$/, '') + '.txt';
48 const filepath = join(getCwd(), finalFilename);
49
50 try {
51 writeFileSync_DEPRECATED(filepath, content, {
52 encoding: 'utf-8',
53 flush: true,
54 });
55 onDone({
56 success: true,
57 message: `Conversation exported to: ${filepath}`,
58 });
59 } catch (error) {
60 onDone({
61 success: false,
62 message: `Failed to export conversation: ${error instanceof Error ? error.message : 'Unknown error'}`,
63 });
64 }
65 };
66
67 // Dialog calls onCancel when Escape is pressed. If we are in the filename
68 // input sub-screen, go back to the option list instead of closing entirely.

Callers

nothing calls this directly

Calls 3

getCwdFunction · 0.85
writeFileSync_DEPRECATEDFunction · 0.85
onDoneFunction · 0.50

Tested by

no test coverage detected