Skip to content

Commit

Permalink
fix (client/karma): Set reloading context flag appropriately to avoid…
Browse files Browse the repository at this point in the history
… full page reload error
  • Loading branch information
nebulou5 committed Oct 21, 2015
1 parent b138619 commit 033caad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/karma.js
Expand Up @@ -24,6 +24,7 @@ var Karma = function (socket, iframe, opener, navigator, location) {

var childWindow = null
var navigateContextTo = function (url) {
reloadingContext = true
if (self.config.useIframe === false) {
if (childWindow === null || childWindow.closed === true) {
// If this is the first time we are opening the window, or the window is closed
Expand All @@ -33,6 +34,7 @@ var Karma = function (socket, iframe, opener, navigator, location) {
} else {
iframe.src = url
}
reloadingContext = false
}

this.setupContext = function (contextWindow) {
Expand Down Expand Up @@ -105,7 +107,6 @@ var Karma = function (socket, iframe, opener, navigator, location) {
this.stringify = stringify

var clearContext = function () {
reloadingContext = true
navigateContextTo('about:blank')
}

Expand Down Expand Up @@ -210,7 +211,6 @@ var Karma = function (socket, iframe, opener, navigator, location) {
// reset hasError and reload the iframe
hasError = false
startEmitted = false
reloadingContext = false
self.config = cfg
navigateContextTo(constant.CONTEXT_URL)

Expand Down

0 comments on commit 033caad

Please sign in to comment.