Skip to content

Commit

Permalink
fix(dev-server): fix reloading same error on start
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed May 17, 2019
1 parent 6ec2cf9 commit a987928
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/compiler/build/init-index-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,22 @@ const APP_LOADING_HTML = `
setInterval(function() {
try {
var url = window.location.pathname + '?' + Math.random();
var xhr = new XMLHttpRequest();
xhr.addEventListener('load', function() {
try {
if (this.responseText.indexOf('app-dev-first-build-loader') === -1) {
window.location.reload(true);
if (this.status < 300) {
if (this.responseText.indexOf('app-dev-first-build-loader') === -1) {
window.location.reload(true);
}
} else if (window.location.pathname !== '/') {
url = '/' + Math.random();
}
} catch (e) {
console.error(e);
}
});
var url = window.location.pathname + '?' + Math.random();
xhr.open('GET', url);
xhr.send();
} catch (e) {
Expand Down

0 comments on commit a987928

Please sign in to comment.