This commit is contained in:
lyswhut
2023-01-06 14:39:44 +08:00
parent 1db54195f5
commit 27c1bf8eb6
30 changed files with 196 additions and 85 deletions
+6 -2
View File
@@ -82,7 +82,9 @@ const migrateFile = async(name: string, targetName: string) => {
if (!await checkPath(path) && await checkPath(oldPath)) {
await fs.promises.copyFile(oldPath, path).catch(err => {
log.error(err)
}).catch(err => log.error(err))
}).catch(err => {
log.error(err)
})
}
}
@@ -108,7 +110,9 @@ export const migrateDataJson = async() => {
if (oldDataFile.listPosition) newData.listScrollPosition = oldDataFile.listPosition
if (oldDataFile.listUpdateInfo) newData.listUpdateInfo = oldDataFile.listUpdateInfo
await fs.promises.writeFile(path, JSON.stringify(newData)).catch(err => log.error(err))
await fs.promises.writeFile(path, JSON.stringify(newData)).catch(err => {
log.error(err)
})
}
+1 -3
View File
@@ -4,9 +4,7 @@ import { join } from 'path'
import fs from 'fs'
import log from 'electron-log'
interface Stores {
[key: string]: Store
}
type Stores = Record<string, Store>
const stores: Stores = {}