Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottzheng committed May 18, 2019
1 parent 397f2ef commit efb4e11
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dist_locales/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
"enableNotify": "啟用通知",
"smartTranslate": "智慧型翻譯",
"titleBar": "標題列"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "copytranslator",
"version": "8.2.0",
"version": "8.2.1",
"private": true,
"description": "Foreign language assisted reading and translation solution",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/core/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const _ = require("lodash");
export const constants = {
appName: "CopyTranslator",
nickName: "Zouwu",
version: "v8.2.0",
version: "v8.2.9",
stage: "alpha",
wiki: "https://copytranslator.github.io/guide",
homepage: "https://copytranslator.github.io",
Expand Down
3 changes: 2 additions & 1 deletion src/tools/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ enum RouteName {
Focus = "Focus",
Contrast = "Contrast",
Settings = "Settings",
Tray = "Tray"
Tray = "Tray",
Update = "Update"
}

interface Action {
Expand Down
15 changes: 11 additions & 4 deletions src/tools/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ function bindUpdateEvents() {
autoUpdater.on("update-available", updateInfo => {
const width = 500,
height = 500;
const bound = (<Controller>(<any>global).controller).win.getBound();
const current_win = (<Controller>(<any>global).controller).win;
const bound = current_win.getBound();
const {
x: xBound,
x: yBound,
Expand All @@ -30,11 +31,17 @@ function bindUpdateEvents() {
titleBarStyle: "hiddenInset",
maximizable: false,
title: "软件更新",
parent: BrowserWindow.getAllWindows()[0],
parent: current_win.window,
icon: nativeImage.createFromPath(envConfig.iconPath)
});
window.loadURL(envConfig.publicUrl + `/#/update`);
window.webContents.on("did-finish-load", function() {
if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
window.loadURL(envConfig.publicUrl + `/#/Update`);
} else {
// Load the index.html when not in development
window.loadURL(`${envConfig.publicUrl}/index.html#Update`);
}
ipcMain.on("releaseNote", (event: any, args: any) => {
(<BrowserWindow>window).webContents.send("releaseNote", updateInfo);
});
});
Expand Down
15 changes: 7 additions & 8 deletions src/views/Update.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ name: Update
notes:
-->
<template>
<div id="update">
<p v-html="releaseName" id="version"></p>
<p>更新日志:</p>
<div v-html="releaseNote" id="releaseNote"></div>
<div>
<h1 v-html="version"></h1>
<h2>更新日志:</h2>
<div v-html="releaseNote"></div>
<el-button type="primary" @click="confirmUpdate()">下载更新</el-button>
</div>
</template>
Expand All @@ -22,7 +22,6 @@ export default {
return {
releaseNote: null,
version: null,
releaseName: null,
updateTitle: null
};
},
Expand All @@ -40,13 +39,12 @@ export default {
}
}
},

created() {
ipcRenderer.on("releaseNote", (event, data) => {
this.releaseNote = data.releaseNotes;
this.version = data.version;
this.releaseName = data.releaseName;
this.version = data.version + " " + data.releaseName;
});
ipcRenderer.send("releaseNote");
}
};
</script>
Expand All @@ -59,5 +57,6 @@ export default {
text-align: left;
font-size: 14px;
padding-left: 30px;
height: 60%;
}
</style>

0 comments on commit efb4e11

Please sign in to comment.