mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2026-06-20 22:00:56 -04:00
fix bug
Former-commit-id: c683b18c102388b880ace99f792d1d2f6d2fc595
This commit is contained in:
@@ -115,19 +115,33 @@ class Header extends React.Component<HeaderProps, HeaderState> {
|
||||
.require("electron")
|
||||
.ipcRenderer.sendSync("storage-location", "ping");
|
||||
let sourcePath = path.join(storageLocation, "config", "readerConfig.json");
|
||||
const readerConfig = JSON.parse(
|
||||
fs.readFileSync(sourcePath, { encoding: "utf8", flag: "r" })
|
||||
);
|
||||
//如果同步文件夹的记录较新,就从同步文件夹同步数据到Koodo
|
||||
if (
|
||||
localStorage.getItem("lastSyncTime") &&
|
||||
parseInt(readerConfig.lastSyncTime) >
|
||||
parseInt(localStorage.getItem("lastSyncTime")!)
|
||||
) {
|
||||
console.log(1);
|
||||
this.syncFromLocation();
|
||||
} else {
|
||||
//否则就把Koodo中数据同步到同步文件夹
|
||||
try {
|
||||
const readerConfig = JSON.parse(
|
||||
fs.readFileSync(sourcePath, { encoding: "utf8", flag: "r" })
|
||||
);
|
||||
//如果同步文件夹的记录较新,就从同步文件夹同步数据到Koodo
|
||||
if (
|
||||
localStorage.getItem("lastSyncTime") &&
|
||||
parseInt(readerConfig.lastSyncTime) >
|
||||
parseInt(localStorage.getItem("lastSyncTime")!)
|
||||
) {
|
||||
console.log(1);
|
||||
this.syncFromLocation();
|
||||
} else {
|
||||
//否则就把Koodo中数据同步到同步文件夹
|
||||
BackupUtil.backup(
|
||||
this.props.books,
|
||||
this.props.notes,
|
||||
this.props.bookmarks,
|
||||
() => {
|
||||
this.props.handleMessage("Sync Successfully");
|
||||
this.props.handleMessageBox(true);
|
||||
},
|
||||
5,
|
||||
() => {}
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
BackupUtil.backup(
|
||||
this.props.books,
|
||||
this.props.notes,
|
||||
|
||||
Reference in New Issue
Block a user