Skip to content

Commit

Permalink
Update push-uniapp.js
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor authored Jun 10, 2023
1 parent 2e3ee85 commit d1a904c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/push-uniapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,13 @@ function createPresenceChannel(channel_name, push)
}

uni.onNetworkStatusChange(function (res) {
for (var i in Push.instances) {
con = Push.instances[i].connection;
con.reconnectInterval = 1;
if (con.state === 'connecting') {
con.connect();
if(res.isConnected) {
for (var i in Push.instances) {
con = Push.instances[i].connection;
con.reconnectInterval = 1;
if (con.state === 'connecting') {
con.connect();
}
}
}
});
Expand Down

0 comments on commit d1a904c

Please sign in to comment.