Skip to content

Commit

Permalink
enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
embbnux committed May 17, 2018
1 parent a4309af commit 5e6623b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
Binary file removed icon.png
Binary file not shown.
15 changes: 4 additions & 11 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const { app, BrowserWindow, ipcMain } = require('electron');
const { app, BrowserWindow, ipcMain, session } = require('electron');
const path = require('path');

let mainWindow;
let willQuitApp = false;

function createMainWindow() {
const ses = session.fromPartition('persist:rc-ev-session');
mainWindow = new BrowserWindow({
width: 300,
height: 540,
Expand All @@ -13,6 +14,7 @@ function createMainWindow() {
webPreferences: {
nodeIntegration: false,
preload: path.join(__dirname, 'preload.js'),
session: ses,
},
show: false,
});
Expand All @@ -22,26 +24,17 @@ function createMainWindow() {
mainWindow.once('ready-to-show', () => {
mainWindow.show()
});
mainWindow.on('close', (event) => {
if (willQuitApp) {
mainWindow = null;
return;
}
event.preventDefault();
mainWindow.hide();
})
}

let notification;
app.on('ready', () => {
createMainWindow();
});

app.on('before-quit', () => willQuitApp = true);

app.on('window-all-closed', () => {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
mainWindow = null;
if (process.platform !== 'darwin') {
app.quit();
}
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ringcentral-embeddable-voice-app",
"version": "0.0.1",
"version": "0.0.3",
"main": "main.js",
"license": "MIT",
"author": {
Expand All @@ -27,7 +27,8 @@
"main.js",
"preload.js",
"icon.png",
"icon.icns"
"icon.icns",
"build/icon.*"
],
"directories": {
"buildResources": "build",
Expand All @@ -40,6 +41,10 @@
"repo": "ringcentral-embeddable-voice-app"
}
],
"mac": {
"category": "public.app-category.business",
"icon": "icon.icns"
},
"dmg": {
"contents": [
{
Expand All @@ -63,7 +68,9 @@
"target": [
"deb",
"AppImage"
]
],
"category": "Telephony",
"desktop": "rc-ev.desktop"
}
}
}
7 changes: 7 additions & 0 deletions rc-ev.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Name=RingCentral Embeddable Voice
Exec=ringcentral-embeddable-voice
Icon=icon.png
Type=Application
Categories=Nework;Telephony;
Terminal=false

2 comments on commit 5e6623b

@AndyHaas
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just tested on my windows machine, Looks good. Great job!

@embbnux
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndyHaas Thanks

Please sign in to comment.