Skip to content

Commit

Permalink
naming logic
Browse files Browse the repository at this point in the history
  • Loading branch information
madisvain committed Nov 23, 2019
1 parent 1c26f4f commit 06c3924
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "upcount",
"author": "Madis Vain <[email protected]>",
"description": "Painless Invoicing Application",
"version": "0.1.2",
"version": "0.1.3",
"private": true,
"scripts": {
"dev:renderer": "umi dev",
Expand Down
20 changes: 9 additions & 11 deletions src/layouts/electron.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { notification, Button } from 'antd';
import router from 'umi/router';

import BaseLayout from './base';

class ElectronLayout extends BaseLayout {
Expand All @@ -22,25 +23,23 @@ class ElectronLayout extends BaseLayout {
});
});

ipcRenderer.on('update_available', (event, data) => {
ipcRenderer.on('updateAvailable', (event, data) => {
notification.info({
key: 'update_available',
placement: 'topRight',
duration: 0,
placement: 'bottomRight',
duration: 10,
message: 'Update Available',
description: 'A new update is available. Downloading now...',
description: 'A new version of Upcount is available. Downloading now ...',
});
});

ipcRenderer.on('update_downloaded', () => {
notification.close('update_available');
notification.info({
placement: 'topRight',
ipcRenderer.on('updateDownloaded', () => {
notification.success({
placement: 'bottomRight',
duration: 0,
message: 'Update Downloaded',
description: (
<div>
Update Downloaded. It will be installed on restart. Restart now?
Upcount version update downloaded. It will be installed after restarting. Restart now?
<Button type="primary" style={{ float: 'right' }} onClick={this.restartApp}>
Restart
</Button>
Expand All @@ -52,7 +51,6 @@ class ElectronLayout extends BaseLayout {

restartApp = () => {
const { ipcRenderer } = window.require('electron');

ipcRenderer.send('restart_app');
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ app.on('activate', () => {

// Autoupdate
autoUpdater.on('update-available', () => {
mainWindow.webContents.send('update_available');
mainWindow.webContents.send('updateAvailable');
});
autoUpdater.on('update-downloaded', () => {
mainWindow.webContents.send('update_downloaded');
mainWindow.webContents.send('updateDownloaded');
});

ipcMain.on('restart_app', () => {
Expand Down

0 comments on commit 06c3924

Please sign in to comment.