Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #5268 from adobe/jhagenst/fix-5110
Browse files Browse the repository at this point in the history
fix 5110: Switching to other file while Live Development is connecting causes it to fail
  • Loading branch information
Narciso Jaramillo committed Sep 24, 2013
2 parents 8f2eec6 + f2a105c commit 36b06bc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/LiveDevelopment/LiveDevelopment.js
Original file line number Diff line number Diff line change
Expand Up @@ -974,12 +974,12 @@ define(function LiveDevelopment(require, exports, module) {

// helper function that actually does the launch once we are sure we have
// a doc and the server for that doc is up and running.
function _doLaunchAfterServerReady() {
function _doLaunchAfterServerReady(doc) {
// update status
_setStatus(STATUS_CONNECTING);

// create live document
_liveDocument = _createDocument(_getCurrentDocument(), EditorManager.getCurrentFullEditor());
_liveDocument = _createDocument(doc, EditorManager.getCurrentFullEditor());

// start listening for requests
_server.add(_liveDocument);
Expand Down Expand Up @@ -1042,7 +1042,10 @@ define(function LiveDevelopment(require, exports, module) {
prepareServerPromise = (doc && _prepareServer(doc)) || new $.Deferred().reject();

// wait for server (StaticServer, Base URL or file:)
prepareServerPromise.done(_doLaunchAfterServerReady);
prepareServerPromise.done(function (result) {
_doLaunchAfterServerReady(doc);
});

prepareServerPromise.fail(function () {
_showWrongDocError();
_openDeferred.reject();
Expand Down

0 comments on commit 36b06bc

Please sign in to comment.