Fix folder display and add validation to file listing operations
- Handle folder names properly in getDisplayName by preserving trailing slash - Add validation to skip invalid objects during listing - Add default values for missing object properties (size, lastModified, etag) - Add debug logging for listObjectsV2 operations to help troubleshoot issues - Add null checks in deleteFolder to prevent errors with invalid objects
This commit is contained in:
@@ -78,6 +78,12 @@ function getFileIcon(filename: string): string {
|
||||
}
|
||||
|
||||
function getDisplayName(filepath: string): string {
|
||||
// Handle folders (ending with /)
|
||||
if (filepath.endsWith('/')) {
|
||||
const parts = filepath.slice(0, -1).split('/');
|
||||
return parts[parts.length - 1] + '/';
|
||||
}
|
||||
|
||||
// Get just the filename from the full path
|
||||
const parts = filepath.split('/');
|
||||
const filename = parts[parts.length - 1];
|
||||
|
||||
Reference in New Issue
Block a user