Merge branch 'release'

This commit is contained in:
Xu Chang 2024-05-21 20:02:52 +08:00
commit ac5f9804e8
3 changed files with 14 additions and 2 deletions

View File

@ -133,6 +133,9 @@ export class SubScriber extends Feature {
if (this.socketState === 'unconnected') {
return this.connect();
}
else if (this.socketState === 'connecting') {
return this.connect();
}
else if (this.socketState === 'connected' && newEvents.length > 0) {
return new Promise((resolve, reject) => {
this.socket.emit('sub', newEvents, (result) => {
@ -176,4 +179,10 @@ export class SubScriber extends Feature {
return this.socket.id;
}
}
closeSocket() {
if (this.socket) {
this.socket.close();
}
}
}

View File

@ -1,6 +1,6 @@
{
"name": "oak-frontend-base",
"version": "5.1.0",
"version": "5.1.1",
"description": "oak框架中前端与业务逻辑无关的平台部分",
"author": {
"name": "XuChang"
@ -23,7 +23,7 @@
"node-schedule": "^2.1.1",
"oak-common-aspect": "~3.0.0",
"oak-domain": "~5.0.8",
"oak-memory-tree-store": "~3.3.0",
"oak-memory-tree-store": "~3.3.1",
"ol": "^7.3.0",
"react-native-device-info": "^10.12.0",
"react-native-localize": "^3.0.4",

View File

@ -173,6 +173,9 @@ export class SubScriber<ED extends EntityDict & BaseEntityDict> extends Feature
if (this.socketState === 'unconnected') {
return this.connect();
}
else if (this.socketState === 'connecting') {
return this.connect();
}
else if (this.socketState === 'connected' && newEvents.length > 0) {
return new Promise(
(resolve, reject) => {