@setoelkahfi / svara / commits / 996d8a7

something v2

mellbacon committed Aug 15, 2022 at 21:08 UTC 996d8a700c2f6dab346ab84d4755387eff8162eb
1 file changed +6 -13
src/components/FileTree/TreeData.ts
+6 -13
@@ -9,6 +9,12 @@ export async function data() {
9 return await loadTree();
10 }
11
12 +export async function loadFile() {
13 + let file = await dialog.open() as string;
14 + if (file === null) return;
15 + return file;
16 +}
17 +
18 async function loadTree() {
19 let children = await fs.readDir(dir, { recursive: true });
20 id = 0;
@@ -42,10 +48,6 @@ function sort(children) {
48 return folders;
49 }
50
45 -export function getFileData(id) {
46 - console.log(cache[id]);
47 -}
48 -
51 export function workspace() {
52 return parentname;
53 }
@@ -69,12 +71,3 @@ function buildTree(children: fs.FileEntry[]) {
71 }
72 return nodes;
73 }
72 -
73 -/*
74 -export async function printTree() {
75 - let dirname = await dialog.open({ directory: true }) as string;
76 - let children = await fs.readDir(dirname, { recursive: true });
77 - console.log(buildTree(children));
78 -}
79 -*/
80 -