Permalink
Browse files

Trigger stateChanged after the connection state has actually changed.

Fixes Issue #598
  • Loading branch information...
halter73 committed Oct 15, 2012
1 parent 9f2e10f commit 5a9600e769f8166715b1f6a4402aafb65d685e87
@@ -73,9 +73,8 @@
changeState = function (connection, expectedState, newState) {
if (expectedState === connection.state) {
- // REVIEW: Should event fire before or after the state change actually occurs?
- $(connection).trigger(events.onStateChanged, [{ oldState: connection.state, newState: newState }]);
connection.state = newState;
+ $(connection).trigger(events.onStateChanged, [{ oldState: connection.state, newState: newState }]);
return true;
}
Oops, something went wrong.

0 comments on commit 5a9600e

Please sign in to comment.