diff --git a/main.js b/main.js index d14f3fe..ed9cdbe 100644 --- a/main.js +++ b/main.js @@ -34,10 +34,7 @@ app.on("ready", () => { ); }); autoUpdater.on("update-not-available", () => { - dialog.showMessageBox({ - title: "没有新版本", - message: "当前已经是最新版本", - }); + console.log("当前已经是最新版本"); }); autoUpdater.on("download-progress", (progressObj) => { diff --git a/package.json b/package.json index 9c6f78b..29d81a8 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { "name": "bigbear-mindmap", - "version": "0.1.1", - "private": true, + "version": "0.1.3", + "private": false, "main": "main.js", "author": "yehuozhili", "description": "a mindmap build with electron", "dependencies": { "electron-is-dev": "^1.2.0", - "electron-store": "^6.0.0" + "electron-store": "^6.0.0", + "electron-updater": "^4.3.1" }, "scripts": { "start": "react-scripts start", @@ -99,7 +100,6 @@ "react": "^16.13.1", "react-dom": "^16.13.1", "bigbear-ui": "^1.0.0", - "@antv/g6": "^3.6.1", - "electron-updater": "^4.3.1" + "@antv/g6": "^3.6.1" } } diff --git a/src/App.js b/src/App.js index d0b6976..e83639d 100644 --- a/src/App.js +++ b/src/App.js @@ -63,18 +63,21 @@ const importNewFile = (li) => { const renameFile = (list, index, setList, v) => { let origin = list[index]; let p = origin.path; - const newPath = origin.isNew ? join(savelocation, v) : join(dirname(p, v)); + const newPath = origin.isNew + ? join(savelocation, v) + : join(dirname(p, v), v); try { fs.statSync(p); fs.renameSync(p, newPath); let newlist = list; newlist[index].title = v; newlist[index].path = newPath; - setList([...newlist]); saveFilesToStore([...newlist]); - } catch { - remote.dialog.showErrorBox(`文件不存在`, `${p}`); + } catch (e) { + console.log(e); + console.log(newPath); + remote.dialog.showErrorBox(`文件不存在或者操作不允许`, `${p}`); } };