chore: 抢单图标与IM心跳修复,排行榜奖励开发前备份
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -515,21 +515,16 @@ function startHeartbeat(app) {
|
||||
let convTick = 0;
|
||||
goEasyConnection.heartbeatInterval = setInterval(() => {
|
||||
if (goEasyConnection.status === 'connected' && wx.goEasy?.im) {
|
||||
wx.goEasy.im.ping({
|
||||
onSuccess: () => {
|
||||
convTick += 1;
|
||||
if (convTick % 3 === 0) {
|
||||
loadConversations(app);
|
||||
}
|
||||
},
|
||||
onFailed: (error) => {
|
||||
console.error('心跳失败:', error);
|
||||
if (isSdkConnected()) return;
|
||||
goEasyConnection.status = 'reconnecting';
|
||||
app.emitEvent('connectionChanged', { status: 'reconnecting' });
|
||||
attemptReconnect(app);
|
||||
},
|
||||
});
|
||||
if (isSdkConnected()) {
|
||||
convTick += 1;
|
||||
if (convTick % 3 === 0) {
|
||||
loadConversations(app);
|
||||
}
|
||||
} else {
|
||||
goEasyConnection.status = 'reconnecting';
|
||||
app.emitEvent('connectionChanged', { status: 'reconnecting' });
|
||||
attemptReconnect(app);
|
||||
}
|
||||
} else if (goEasyConnection.autoReconnect && !isSdkConnected()) {
|
||||
ensureConnection(app);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user