Skip to content

Commit b91a19f

Browse files
committed
remove circle dependency
1 parent eca1929 commit b91a19f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

ezy-client/ezy-client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Proxy from './proxy'
22
import Manager from './ezy-managers'
33
import EzySetup from './ezy-setup'
4-
import {EzyDisconnectReason} from './ezy-constants'
4+
import Const from './ezy-constants'
55
import EzyLogger from './ezy-logger'
66

77
class EzyClient {
@@ -32,7 +32,7 @@ class EzyClient {
3232
}
3333

3434
disconnect(reason) {
35-
var r = reason ? reason : EzyDisconnectReason.CLOSE;
35+
var r = reason ? reason : Const.EzyDisconnectReason.CLOSE;
3636
Proxy.run("disconnect", {clientName : this.name, reason : r});
3737
}
3838

socket/SocketProxy.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ class SocketProxy {
5252
routerController.updateViews('change', 'message');
5353
};
5454

55+
let exitAppHandler = new Ezy.AppExitHandler();
56+
exitAppHandler.postHandle = function (app, data) {
57+
this.client.close();
58+
};
59+
5560
let disconnectionHandler = new Ezy.DisconnectionHandler();
5661
disconnectionHandler.preHandle = function (event) {
5762
let routerController = mvc.getController("router");
@@ -64,6 +69,7 @@ class SocketProxy {
6469
setup.addDataHandler(Ezy.Command.LOGIN, loginSuccessHandler);
6570
setup.addDataHandler(Ezy.Command.LOGIN_ERROR, loginErrorHandler);
6671
setup.addDataHandler(Ezy.Command.APP_ACCESS, accessAppHandler);
72+
setup.addDataHandler(Ezy.Command.APP_EXIT, exitAppHandler);
6773
let setupApp = setup.setupApp(APP_NAME);
6874

6975
let messageController = mvc.getController("message");

0 commit comments

Comments
 (0)