Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions app/packages/preload/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ export async function syncWikiFromSeed() {
// get all file paths of .md files inside the folder
const filePaths = await markdownFilePaths(wikiFolderPath)
// save each file to tinybase
filePaths.map((filePath) => {
saveFileToTinybase(wikiFolderPath, filePath, tinybase)
})
await Promise.all(
filePaths.map(async (filePath) => {
await saveFileToTinybase(wikiFolderPath, filePath, tinybase)
})
)

console.log(tinybase.getStore().getTables(), "Tables are loaded")

await tinybase.save() // and saved to sqlite
}

// load all the .md files from folder path into tinybase
Expand Down
2 changes: 1 addition & 1 deletion app/packages/preload/src/tinybase/wiki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export async function saveFileToTinybase(
)
}
tinybase.getStore().finishTransaction()
await tinybase.save()

return
}

Expand Down