show all files in explore

This commit is contained in:
codetypes committed 2024-05-19 22:27:58 +08:00
1 parent fa5644fda7
commit 9e71989ff5
3 files changed
+216 -187

No files matched your search

+3 -5
View File
@@ -161,14 +161,12 @@ export type WorkspaceStore = {
const loadFileTree = (workdir: string, filename: string) => {
const fullpath = fs.realpathSync(`${workdir}/${filename}`);
if (!fs.existsSync(fullpath)) {
if (!fs.existsSync(fullpath) || filename.endsWith(".DS_Store")) {
return;
}
const stat = fs.statSync(fullpath);
if (!(stat.isDirectory() || fullpath.endsWith(".json"))) {
return;
}
const data: FileTreeType = {
path: fullpath.replaceAll(Path.sep, "/"),
@@ -492,7 +490,7 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
let updated = false;
allFiles.forEach((file) => (file.exists = false));
const collect = (fileNode?: FileTreeType) => {
if (fileNode?.isLeaf) {
if (fileNode?.isLeaf && b3util.isTreeFile(fileNode.path)) {
const path = workspace.relative(fileNode.path);
let fileMeta = allFiles.get(path);
if (!fileMeta) {