Skip to content

Commit 2e3ee85

Browse files
authored
Update push-uniapp.js
1 parent b4c87c9 commit 2e3ee85

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/push-uniapp.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,15 @@ function createPresenceChannel(channel_name, push)
189189
return createPrivateChannel(channel_name, push);
190190
}
191191

192-
/*window.addEventListener('online', function(){
193-
var con;
192+
uni.onNetworkStatusChange(function (res) {
194193
for (var i in Push.instances) {
195194
con = Push.instances[i].connection;
196195
con.reconnectInterval = 1;
197196
if (con.state === 'connecting') {
198197
con.connect();
199198
}
200199
}
201-
});*/
202-
200+
});
203201

204202
function Connection(options) {
205203
this.dispatcher = new Dispatcher();
@@ -821,4 +819,4 @@ function formatParams(data){
821819
return arr.join('&');
822820
}
823821

824-
export default Push
822+
export default Push

0 commit comments

Comments
 (0)