diff --git a/html/src/app.js b/html/src/app.js index dd6b8775..4f9a8708 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -3223,6 +3223,7 @@ speechSynthesis.getVoices(); userId: content.userId } }); + $app.APILastOnline.set(content.userId, Date.now()); break; case 'friend-active': @@ -3668,6 +3669,8 @@ speechSynthesis.getVoices(); $app.data.debug = false; + $app.data.APILastOnline = new Map(); + $app.data.sharedFeed = { gameLog: { wrist: [], @@ -4928,7 +4931,7 @@ speechSynthesis.getVoices(); } }; - $app.methods.updateFriend = function (id, state, origin) { + $app.methods.updateFriend = async function (id, state, origin) { var ctx = this.friends.get(id); if (typeof ctx === 'undefined') { return; @@ -5004,8 +5007,14 @@ speechSynthesis.getVoices(); }); } } else { - if (ctx.state === 'online' && ref.state === 'active' && state === 'active') { - return; + if (ctx.state === 'online' && state === 'active') { + await new Promise(resolve => setTimeout(resolve, 50000)); + if (this.APILastOnline.has(id)) { + var date = this.APILastOnline.get(id); + if (date > Date.now() - 60000) { + return; + } + } } if (ctx.state === 'online') { if (ctx.isVIP) {