Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Nov 23, 2024
1 parent 077044d commit 50a88c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/experimental/nodes/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const App: React.FC = () => {
}
// Check if it's a command output
else if (messageData.data?.data_type === "text" &&
messageData.data.text.includes("CmdOutputObservation") &&
messageData.data.text.includes("CmdOutputObservation") &&
!messageData.data.text.includes("**FILE_SYSTEM_REFRESH**")) {
// Extract command output from the message
const parts = messageData.data.text.split("**CmdOutputObservation (source=None, exit code=0)**");
Expand Down
16 changes: 8 additions & 8 deletions examples/experimental/nodes/frontend/src/hooks/useFileSystems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ export const useFileSystem = () => {

const updateFileSystemFromList = (fileList: string[]) => {
// Initialize root workspace folder
const newTree: FileNode[] = [{
name: 'workspace',
type: 'folder',
path: '/workspace',
children: []
const newTree: FileNode[] = [{
name: 'workspace',
type: 'folder',
path: '/workspace',
children: []
}];

// Create a set of existing file paths for quick lookup
Expand All @@ -147,7 +147,7 @@ export const useFileSystem = () => {
// Clean up the file path
const cleanedPath = filePath.replace(/^\/workspace\//, '').trim().replace(/\\r/g, ''); // Remove \r
const segments = cleanedPath.split('/').filter(Boolean);

if (segments.length === 0) return; // Skip if it's just the workspace folder

let currentLevel = newTree[0].children!;
Expand All @@ -156,7 +156,7 @@ export const useFileSystem = () => {
// Process each segment of the path
segments.forEach((segment, index) => {
currentPath += '/' + segment;

// If we're at the last segment, it's a file
if (index === segments.length - 1) {
// Check if the file already exists
Expand All @@ -166,7 +166,7 @@ export const useFileSystem = () => {
type: 'file',
path: currentPath
});
}
}
} else {
// It's a folder
let folder = currentLevel.find(
Expand Down

0 comments on commit 50a88c1

Please sign in to comment.