We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebd9f29 commit 5406083Copy full SHA for 5406083
src/main/services/db/index.ts
@@ -23,9 +23,13 @@ const DEFAULT_FOLDER = {
23
updatedAt: new Date().valueOf()
24
}
25
26
-const fileDb = store.preferences.get('storagePath') + `/${DB_NAME}`
+const getFileDb = () => {
27
+ return store.preferences.get('storagePath') + `/${DB_NAME}`
28
+}
29
30
export const createDb = () => {
31
+ const fileDb = getFileDb()
32
+
33
if (fs.existsSync(fileDb)) {
34
return
35
} else {
@@ -47,6 +51,7 @@ export const createDb = () => {
47
51
48
52
49
53
const writeToFile = (db: object) => {
54
50
55
const data = JSON.stringify(db, null, 2)
56
fs.writeFileSync(fileDb, data)
57
0 commit comments