-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.js
48 lines (41 loc) · 1.01 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const electron = require('electron')
// Module to control application life.
const {app, ipcMain, Menu} = require('electron')
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow
const mobilecaddy = require('mobilecaddy-electron')
const isDev = require('electron-is-dev');
require('electron-debug')();
/**
* ----------------------------------------------------------------------------
* M E N U
* ----------------------------------------------------------------------------
*/
const template = [
{
label: 'File',
submenu: [
{
role: 'quit'
},
{
type: 'separator'
},
{
label: 'Clear cache and Quit',
click (item, focusedWindow) {
clearCacheAndQuit();
}
}
]
}
];
const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
/**
* @function clearCacheAndQuit
* @description Clears all applicaition data and quits the app
*/
function clearCacheAndQuit(){
mobilecaddy.logout();
}