Skip to content

Commit

Permalink
Fixed bug where initial session state was being reloaded if
Browse files Browse the repository at this point in the history
save-session-state-to-server failed.
  • Loading branch information
adufilie committed Feb 3, 2012
1 parent 7d2fd88 commit dcfc7f2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions WeaveClient/src/weave/VisApplication.as
Expand Up @@ -213,18 +213,22 @@ package weave
// disable interface until connected to admin console
var _this:VisApplication = this;
_this.enabled = false;
var resultHandler:Function = function(..._):void
var resultHandler:Function = function(event:ResultEvent, token:Object = null):void
{
_this.enabled = true;
adminService = pendingAdminService;
setupVisMenuItems(); // make sure 'save session state to server' is shown
downloadConfigFile();
};
var faultHandler:Function = function(..._):void
var faultHandler:Function = function(event:FaultEvent = null, token:Object = null):void
{
_this.enabled = true;
Alert.show("Unable to connect to the Admin Console.\nYou will not be able to save your session state to the server.", "Connection error");
downloadConfigFile();
// do not re-download config file if this function was called as a grouped callback.
if (event) // event==null if called as grouped callback
{
_this.enabled = true;
downloadConfigFile();
}
};
var pendingAdminService:LocalAsyncService = new LocalAsyncService(this, false, getFlashVarAdminConnectionName());
pendingAdminService.errorCallbacks.addGroupedCallback(this, faultHandler);
Expand Down Expand Up @@ -480,8 +484,8 @@ package weave
Alert.show(String(event.result), "Admin Console Response");
},
function(event:FaultEvent, token:Object = null):void
{
Alert.show(event.fault.message, event.fault.name);
{
reportError(event.fault, "Unable to connect to Admin Console");
},
null
));
Expand Down

0 comments on commit dcfc7f2

Please sign in to comment.