Commit 0fbae700 authored by Mihkel Putrinš's avatar Mihkel Putrinš

refactor

parent ac5b3a02
......@@ -23,12 +23,11 @@ if (IS_DEV) {
}
console.log('----==== ' + pjson.name + ' v.' + pjson.version + ' (build ' + (pjson.build) + ') ====----')
var web_preferences = {
'partition': 'persist:panustaja (build ' + (pjson.build) + ')',
'page-visibility': true, // Prevent throttling DOM timers (app gets less priority while in background)
}
app.on('ready', function() {
// USER_PATH = path.join(app.getPath('temp'), 'user.json')
var web_preferences = {
'partition': 'persist:panustaja (build ' + (pjson.build) + ')',
}
windows.authWindow = new BrowserWindow({ width: 900, height: 600, show: true, 'web-preferences': web_preferences })
// windows.authWindow.webContents.openDevTools(true)
var title = pjson.name + ' v.' + pjson.version + (pjson.version.indexOf('-') > -1 ? pjson.build : '') + ' | Logi sisse'
......@@ -49,10 +48,6 @@ app.on('ready', function() {
windows.authWindow.webContents.selectAll()
windows.authWindow.webContents.copy()
var web_preferences = {
'partition': 'persist:panustaja (build ' + (pjson.build) + ')',
'page-visibility': true, // Prevent throttling DOM timers (app gets less priority while in background)
}
setTimeout(function () {
mainWindow = new BrowserWindow({ width: 900, height: 600, show: true, 'web-preferences': web_preferences })
mainWindow.setTitle('Panustaja')
......
var sizes = ['B', 'KB', 'MB', 'GB', 'TB']
function bytesToSize(bytes) {
if (bytes === undefined) { bytes = 0 }
var sizes = ['B', 'KB', 'MB', 'GB', 'TB']
if (bytes === 0) { return '0 B' }
if (bytes === undefined or bytes === 0) { return '0 B' }
try {
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10)
var decimals = Math.max(0, i-1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment