perf: slow down DHT announcing on errors (#1186)

This commit is contained in:
Levi authored and GitHub committed 2026-01-14 20:04:21 +08:00
1 parent f86a379f93
commit c9626cb389
17 files changed
+573 -563

No files matched your search

+7 -1
View File
@@ -8,7 +8,13 @@ class FileExplorer {
if (await FileSystemEntity.isFile(filePath)) {
_openFile(filePath);
} else if (await FileSystemEntity.isDirectory(filePath)) {
_openDirectory(filePath);
await _openDirectory(filePath);
} else {
// If file does not exist, open its parent directory
final parentPath = path.dirname(filePath);
if (await FileSystemEntity.isDirectory(parentPath)) {
await _openDirectory(parentPath);
}
}
}