This commit is contained in:
parent
7209fa2cd0
commit
5ca4929a45
|
|
@ -23,18 +23,18 @@ Page({
|
|||
|
||||
// }
|
||||
// })
|
||||
onStop()
|
||||
const that = this;
|
||||
wx.getStorage({
|
||||
key: 'isConnected',
|
||||
success(res: any) {
|
||||
if (res.data) {
|
||||
this.setData({
|
||||
that.setData({
|
||||
netWorkErrorDialog: true,
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
onStop()
|
||||
wx.getStorage({
|
||||
key: 'historicalList',
|
||||
success(res: any) {
|
||||
|
|
|
|||
|
|
@ -13,17 +13,9 @@ export const startSignalr = async (callBack: Function) => {
|
|||
})
|
||||
.build();
|
||||
connection.start().then(() => {
|
||||
wx.setStorage({
|
||||
key: "reconnect",
|
||||
data: true
|
||||
})
|
||||
callBack()
|
||||
})
|
||||
connection.onclose(() => {
|
||||
wx.setStorage({
|
||||
key: "reconnect",
|
||||
data: false
|
||||
})
|
||||
startConnection()
|
||||
});
|
||||
}
|
||||
|
|
@ -32,10 +24,6 @@ export const startSignalr = async (callBack: Function) => {
|
|||
const routes = getCurrentPages()
|
||||
if (connection.state !== signalR.HubConnectionState.Connected && routes[routes.length - 1].route === 'pages/meeting/index') {
|
||||
connection.start().then(() => {
|
||||
wx.setStorage({
|
||||
key: "reconnect",
|
||||
data: true
|
||||
})
|
||||
}).catch(err => {
|
||||
setTimeout(startConnection, 3000);
|
||||
});
|
||||
|
|
@ -203,10 +191,6 @@ export const onSignalr = (callBack: Function) => {
|
|||
}
|
||||
}
|
||||
export const onStop = async () => {
|
||||
wx.setStorage({
|
||||
key: "reconnect",
|
||||
data: false
|
||||
})
|
||||
agora.destroy();
|
||||
if (connection) {
|
||||
connection.stop()
|
||||
|
|
|
|||
Loading…
Reference in New Issue