Skip to content

Commit 1c42513

Browse files
committed
2.0 - Auto updater fix
1 parent e880959 commit 1c42513

File tree

6 files changed

+107
-106
lines changed

6 files changed

+107
-106
lines changed

app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"main": "index.html",
33
"name": "yt-app",
4-
"description": "Youtube Player based on Angular and Typescript",
4+
"description": "YouTube Player",
55
"author": "Alex Olari <queadx@gmail.com>",
6-
"version": "1.0.0",
6+
"version": "1.0.1",
77
"keywords": [
88
"youtube app",
99
"node-webkit"

dist/index.html

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,57 @@
1313
<div class="updates" style="position: fixed; top: 0; z-index: 999; background-color: red; color: white">
1414
<div id="output"></div>
1515
</div>
16-
<app-yt>
17-
<div class="loading-app">
18-
<i class="fa fa-circle-o-notch fa-spin fa-2x fa-fw"></i>
19-
<span class="sr-only">Loading...</span>
20-
</div>
21-
</app-yt>
22-
<script>
23-
const AutoUpdater = require( "nw-autoupdater" ),
24-
updater = new AutoUpdater( require( "./package.json" ) ),
25-
output = document.querySelector( "#output" );
26-
27-
async function main(){
28-
try {
29-
// Update copy is running to replace app with the update
30-
if ( updater.isSwapRequest() ) {
31-
output.innerHTML += `\nSwapping...`;
32-
await updater.swap();
33-
output.innerHTML += `\nDone...`;
34-
await updater.restart();
35-
return;
36-
}
37-
// Download/unpack update if any available
38-
const rManifest = await updater.readRemoteManifest();
39-
const needsUpdate = await updater.checkNewVersion( rManifest );
40-
if ( !needsUpdate ) {
41-
output.innerHTML += `\nIs up to date...`;
42-
return;
43-
}
44-
if ( !confirm( "New release is available. Do you want to upgrade?" ) ) {
45-
return;
46-
}
47-
// Subscribe for progress events
48-
updater.on( "download", ( downloadSize, totalSize ) => {
49-
output.innerHTML = `Downloading...`;
50-
console.log( "download progress", Math.floor( downloadSize / totalSize * 100 ), "%" );
51-
});
52-
updater.on( "install", ( installFiles, totalFiles ) => {
53-
output.innerHTML = `Installing...\n`;
54-
console.log( "install progress", Math.floor( installFiles / totalFiles * 100 ), "%" );
55-
});
56-
const updateFile = await updater.download( rManifest );
57-
await updater.unpack( updateFile );
58-
alert( `The application will automatically restart to finish installing the update` );
59-
await updater.restartToSwap();
60-
} catch ( e ) {
61-
console.error( e );
16+
<app-yt>
17+
<div class="loading-app">
18+
<i class="fa fa-circle-o-notch fa-spin fa-2x fa-fw"></i>
19+
<span class="sr-only">Loading...</span>
20+
</div>
21+
</app-yt>
22+
<script>
23+
const AutoUpdater = require( "nw-autoupdater" ),
24+
updater = new AutoUpdater( require( "./package.json" ) ),
25+
output = document.querySelector( "#output" );
26+
27+
async function main(){
28+
try {
29+
// Update copy is running to replace app with the update
30+
if ( updater.isSwapRequest() ) {
31+
output.innerHTML += `\nSwapping...`;
32+
await updater.swap();
33+
output.innerHTML += `\nDone...`;
34+
await updater.restart();
35+
return;
36+
}
37+
// Download/unpack update if any available
38+
const rManifest = await updater.readRemoteManifest();
39+
const needsUpdate = await updater.checkNewVersion( rManifest );
40+
if ( !needsUpdate ) {
41+
output.innerHTML += `\nIs up to date...`;
42+
return;
43+
}
44+
if ( !confirm( "New release is available. Do you want to upgrade?" ) ) {
45+
return;
46+
}
47+
// Subscribe for progress events
48+
updater.on( "download", ( downloadSize, totalSize ) => {
49+
output.innerHTML = `Downloading...`;
50+
console.log( "download progress", Math.floor( downloadSize / totalSize * 100 ), "%" );
51+
});
52+
updater.on( "install", ( installFiles, totalFiles ) => {
53+
output.innerHTML = `Installing...\n`;
54+
console.log( "install progress", Math.floor( installFiles / totalFiles * 100 ), "%" );
55+
});
56+
const updateFile = await updater.download( rManifest );
57+
await updater.unpack( updateFile );
58+
alert( `The application will automatically restart to finish installing the update` );
59+
await updater.restartToSwap();
60+
} catch ( e ) {
61+
console.error( e );
62+
}
6263
}
63-
}
64-
output.innerHTML = `Application v${nw.App.manifest.version}\n`;
65-
main();
64+
output.innerHTML = `Application v${nw.App.manifest.version}\n`;
65+
main();
6666

67-
</script>
67+
</script>
68+
<script type="text/javascript" src="inline.bundle.js"></script><script type="text/javascript" src="polyfills.bundle.js"></script><script type="text/javascript" src="styles.bundle.js"></script><script type="text/javascript" src="vendor.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script></body>
6869
</html>
69-
<script type="text/javascript" src="inline.bundle.js"></script><script type="text/javascript" src="polyfills.bundle.js"></script><script type="text/javascript" src="styles.bundle.js"></script><script type="text/javascript" src="vendor.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script>

dist/inline.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"main": "index.html",
33
"name": "yt-app",
4-
"description": "Youtube Player based on Angular and Typescript",
4+
"description": "YouTube Player",
55
"author": "Alex Olari <queadx@gmail.com>",
66
"version": "1.0.0",
77
"keywords": [

dist/vendor.bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ var YoutubePlayerService = (function () {
6565
var /** @type {?} */ doc = YoutubePlayerService.win.document;
6666
var /** @type {?} */ playerApiScript = doc.createElement("script");
6767
playerApiScript.type = "text/javascript";
68-
playerApiScript.src = options.protocol + "://www.youtube.com/iframe_api";
68+
playerApiScript.src = "https://www.youtube.com/iframe_api";
6969
doc.body.appendChild(playerApiScript);
7070
};
7171
/**

0 commit comments

Comments
 (0)