Skip to content

Commit

Permalink
fix _onMigrate
Browse files Browse the repository at this point in the history
  • Loading branch information
lorensr committed Sep 2, 2016
1 parent b024289 commit 7cd21b6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions reloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ Reloader = {

updateAvailable: new ReactiveVar(false),

reload() {
prereload() {
// Show the splashscreen
navigator.splashscreen.show();

// Set the refresh flag
localStorage.setItem('reloaderWasRefreshed', Date.now());
},

// Reload the page
reload() {
this.prereload()
window.location.replace(window.location.href);
},

Expand Down Expand Up @@ -152,20 +154,21 @@ Reloader = {
}
},

_onMigrate() {
// https://github.com/meteor/meteor/blob/devel/packages/reload/reload.js#L104-L122
_onMigrate(retry) {
if (this._options.refresh === 'instantly') {

this.reload();
this.prereload()

// return [true, {}];
return [true, {}];

} else {

// Set the flag
this.updateAvailable.set(true);

// Don't refresh yet
return false;
return [false];

}
}
Expand Down Expand Up @@ -203,8 +206,8 @@ document.addEventListener("pause", function() {


// Capture the reload
Reload._onMigrate(function (retry) {
Reloader._onMigrate();
Reload._onMigrate('jamielob:reloader', function (retry) {
return Reloader._onMigrate(retry);
});


Expand Down

0 comments on commit 7cd21b6

Please sign in to comment.