Skip to content

Commit

Permalink
fix update
Browse files Browse the repository at this point in the history
  • Loading branch information
antiboredom committed Oct 23, 2017
1 parent c992335 commit fc1feb9
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 46 deletions.
21 changes: 3 additions & 18 deletions desktop/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,29 +187,15 @@ autoUpdater.on('error', (ev, err) => {

autoUpdater.on('download-progress', (ev, progressObj) => {
// log.warn('Download progress...');
if (windows['update.html']) {
windows['update.html'].webContents.send('progress', progressObj);
}
// if (windows['update.html']) {
// windows['update.html'].webContents.send('progress', progressObj);
// }
});

autoUpdater.on('update-downloaded', (ev, info) => {
autoUpdater.quitAndInstall();
});

function testUpdate() {
let updateWin = makeWindow('update.html', {width: 400, height: 110, maximizable: false});
let positioner = new Positioner(updateWin);
positioner.move('trayCenter', tray.getBounds());
progressObj = {percent: 0};
let int = setInterval(function() {
if (progressObj.percent >= 100) clearInterval(int);
if (windows['update.html']) {
windows['update.html'].webContents.send('progress', progressObj);
}
progressObj.percent += 10;
}, 300);
}

app.on('ready', () => {
tray = new Tray(activeTrayImage);
contextMenu = Menu.buildFromTemplate([
Expand Down Expand Up @@ -308,7 +294,6 @@ app.on('ready', () => {
'--pass': mySettings.uuid + ':[email protected]'
});
miner.start();
// testUpdate();
});

app.on('quit', () => {
Expand Down
2 changes: 1 addition & 1 deletion desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bailbloc",
"version": "1.0.14",
"version": "1.0.15",
"description": "converts computational cycles in bail funds",
"main": "main.js",
"scripts": {
Expand Down
119 changes: 92 additions & 27 deletions desktop/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,108 @@
<title>Bail Bloc Update</title>
<link rel="stylesheet" href="style.css">
<style>
#progress {
height: 15px;
border: 1px solid red;
p {
text-align: left;
float: left;
}

#progress div {
width: 0%;
height: 100%;
background-color: red;
transition: 0.5s all;
overflow: hidden;
#floatingCirclesG {
position: relative;
width: 38px;
height: 38px;
margin: auto;
transform: scale(0.6);
float: right;
}
p {
text-align: left;

.f_circleG {
position: absolute;
background-color: rgb(255, 255, 255);
height: 7px;
width: 7px;
border-radius: 4px;
animation-name: f_fadeG;
animation-duration: 1.2s;
animation-iteration-count: infinite;
animation-direction: normal;
}

#frotateG_01 {
left: 0;
top: 16px;
animation-delay: 0.45s;
}

#frotateG_02 {
left: 4px;
top: 4px;
animation-delay: 0.6s;
}

#frotateG_03 {
left: 16px;
top: 0;
animation-delay: 0.75s;
}

#frotateG_04 {
right: 4px;
top: 4px;
animation-delay: 0.9s;
}

#frotateG_05 {
right: 0;
top: 16px;
animation-delay: 1.05s;
}

#frotateG_06 {
right: 4px;
bottom: 4px;
animation-delay: 1.2s;
}

#frotateG_07 {
left: 16px;
bottom: 0;
animation-delay: 1.35s;
}

#frotateG_08 {
left: 4px;
bottom: 4px;
animation-delay: 1.5s;
}



@keyframes f_fadeG {
0% {
background-color: rgb(0, 0, 0);
}

100% {
background-color: rgb(255, 255, 255);
}
}
</style>
</head>

<body>
<div id="container">
<p>Bail Bloc is updating to the newest version.
<div id="progress">
<div></div>
</div>
<p>Bail Bloc is updating to the newest version.</p>
<div id="floatingCirclesG">
<div class="f_circleG" id="frotateG_01"></div>
<div class="f_circleG" id="frotateG_02"></div>
<div class="f_circleG" id="frotateG_03"></div>
<div class="f_circleG" id="frotateG_04"></div>
<div class="f_circleG" id="frotateG_05"></div>
<div class="f_circleG" id="frotateG_06"></div>
<div class="f_circleG" id="frotateG_07"></div>
<div class="f_circleG" id="frotateG_08"></div>
</div>
</div>
<script>
const { ipcRenderer, remote } = require('electron');
const $ = require('./jquery.min.js');
let win = remote.getCurrentWindow();

ipcRenderer.on('progress', function(event, p) {
console.log(p);
$('#progress div').css({
width: p.percent + '%'
});
});
</script>
</body>

</html>

0 comments on commit fc1feb9

Please sign in to comment.