|
|
@ -38,6 +38,7 @@ const config = new Config({ |
|
|
|
,locale: 'en' |
|
|
|
,locale: 'en' |
|
|
|
,enable_hidpi_support: false |
|
|
|
,enable_hidpi_support: false |
|
|
|
,default_service: 'ramboxTab' |
|
|
|
,default_service: 'ramboxTab' |
|
|
|
|
|
|
|
,sendStatistics: false |
|
|
|
|
|
|
|
|
|
|
|
,x: undefined |
|
|
|
,x: undefined |
|
|
|
,y: undefined |
|
|
|
,y: undefined |
|
|
@ -277,7 +278,7 @@ function updateBadge(title) { |
|
|
|
title = title.split(" - ")[0]; //Discard service name if present, could also contain digits
|
|
|
|
title = title.split(" - ")[0]; //Discard service name if present, could also contain digits
|
|
|
|
var messageCount = title.match(/\d+/g) ? parseInt(title.match(/\d+/g).join("")) : 0; |
|
|
|
var messageCount = title.match(/\d+/g) ? parseInt(title.match(/\d+/g).join("")) : 0; |
|
|
|
messageCount = isNaN(messageCount) ? 0 : messageCount; |
|
|
|
messageCount = isNaN(messageCount) ? 0 : messageCount; |
|
|
|
|
|
|
|
|
|
|
|
tray.setBadge(messageCount, config.get('systemtray_indicator')); |
|
|
|
tray.setBadge(messageCount, config.get('systemtray_indicator')); |
|
|
|
|
|
|
|
|
|
|
|
if (process.platform === 'win32') { // Windows
|
|
|
|
if (process.platform === 'win32') { // Windows
|
|
|
@ -336,6 +337,10 @@ ipcMain.on('setConfig', function(event, values) { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ipcMain.on('sendStatistics', function(event) { |
|
|
|
|
|
|
|
event.returnValue = config.get('sendStatistics'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
ipcMain.on('validateMasterPassword', function(event, pass) { |
|
|
|
ipcMain.on('validateMasterPassword', function(event, pass) { |
|
|
|
if ( config.get('master_password') === require('crypto').createHash('md5').update(pass).digest('hex') ) { |
|
|
|
if ( config.get('master_password') === require('crypto').createHash('md5').update(pass).digest('hex') ) { |
|
|
|
createWindow(); |
|
|
|
createWindow(); |
|
|
|