Skip to content
This repository has been archived by the owner on Nov 12, 2018. It is now read-only.

Commit

Permalink
Bump version number to v1.4.0.
Browse files Browse the repository at this point in the history
 - Use electron v1.3.4 to pack the app.
 - Fix issue #217. Will not check update after window reloaded.
  • Loading branch information
Zhongyi Tong committed Aug 24, 2016
1 parent a09d16b commit c0c4667
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electronic-wechat",
"version": "1.3.0",
"version": "1.4.0",
"description": "An Electron application for WeChat",
"main": "src/main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi

ignore_list="dist|scripts|\.idea|.*\.md|.*\.yml|node_modules/nodejieba"

electron-packager . "${APP_NAME}" --platform=$PLATFORM --arch=$ARCH --version=1.1.0 --app-version=1.3.0 --asar --icon=assets/icon.icns --overwrite --out=./dist --ignore=${ignore_list}
electron-packager . "${APP_NAME}" --platform=$PLATFORM --arch=$ARCH --version=1.3.4 --app-version=1.4.0 --asar --icon=assets/icon.icns --overwrite --out=./dist --ignore=${ignore_list}

if [ $? -eq 0 ]; then
echo -e "$(tput setaf 2)Packaging for $PLATFORM $ARCH succeeded.$(tput sgr0)\n"
Expand Down
2 changes: 2 additions & 0 deletions src/handlers/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const Common = require('../common');

class UpdateHandler {
checkForUpdate(version, silent) {
UpdateHandler.CHECKED = true;
let promise = new Promise((res, rej) => {
if (Common.ELECTRON == app.getName()) {
rej(Common.UPDATE_ERROR_ELECTRON);
Expand Down Expand Up @@ -79,5 +80,6 @@ class UpdateHandler {
};
}

UpdateHandler.CHECKED = false;

module.exports = UpdateHandler;
8 changes: 5 additions & 3 deletions src/windows/controllers/wechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,20 @@ class WeChatWindow {
this.wechatWindow.webContents.insertCSS(CSSInjector.osxCSS);
}

new UpdateHandler().checkForUpdate(`v${app.getVersion()}`, true);
if (!UpdateHandler.CHECKED) {
new UpdateHandler().checkForUpdate(`v${app.getVersion()}`, true);
}
});

this.wechatWindow.webContents.on('new-window', (event, url) => {
event.preventDefault();
shell.openExternal(new MessageHandler().handleRedirectMessage(url));
});

this.wechatWindow.webContents.on('will-navigate', (event, url) => {
if (url.endsWith('/fake')) event.preventDefault();
});

}

loadURL(url) {
Expand Down

0 comments on commit c0c4667

Please sign in to comment.