MCPcopy Create free account
hub / github.com/winfunc/opcode / navigateBack

Function navigateBack

src/components/FilePicker.tsx:333–345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

331 };
332
333 const navigateBack = () => {
334 if (pathHistory.length > 1) {
335 const newHistory = [...pathHistory];
336 newHistory.pop(); // Remove current
337 const previousPath = newHistory[newHistory.length - 1];
338
339 // Don't go beyond the base path
340 if (previousPath.startsWith(basePath) || previousPath === basePath) {
341 setCurrentPath(previousPath);
342 setPathHistory(newHistory);
343 }
344 }
345 };
346
347 const handleEntryClick = (entry: FileEntry) => {
348 // Single click always selects (file or directory)

Callers 1

handleKeyDownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected