From 6af20fd69946b072ab5e912d9d942c8b4f345f5c Mon Sep 17 00:00:00 2001 From: Natsumi Date: Mon, 4 Jan 2021 07:41:04 +1300 Subject: [PATCH] friend log notification fixes --- html/src/app.js | 2 +- html/src/vr.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/html/src/app.js b/html/src/app.js index 7a26496f..ccb6439b 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -3497,7 +3497,7 @@ speechSynthesis.getVoices(); // TrustLevel, Friend, FriendRequest, Unfriend, DisplayName var { data } = this.friendLogTable; var j = this.friendLogTable.data.length; - for (i = j - 1; i >= j - 6; i--) { + for (i = j - 1; i >= j - ((j > 10) ? 10 : j); i--) { var ctx = data[i]; if (ctx.type !== 'FriendRequest') { arr.push({ diff --git a/html/src/vr.js b/html/src/vr.js index e309dba8..f43e6918 100644 --- a/html/src/vr.js +++ b/html/src/vr.js @@ -687,6 +687,12 @@ speechSynthesis.getVoices(); map[feed.senderUsername] < feed.created_at) { map[feed.senderUsername] = feed.created_at; } + } else if (feed.type === 'Friend' || + feed.type === 'Unfriend') { + if (!map[feed.displayName] || + map[feed.displayName] < feed.created_at) { + map[feed.displayName] = feed.created_at; + } } }); // disable notification on busy