Small fixes

This commit is contained in:
Natsumi
2021-01-18 06:24:26 +13:00
parent 0cd033366b
commit 5c399d5f2f
2 changed files with 12 additions and 7 deletions
+11 -6
View File
@@ -3481,10 +3481,10 @@ speechSynthesis.getVoices();
++j; ++j;
} }
} }
// invite, requestInvite, friendRequest
var { data } = this.notificationTable; var { data } = this.notificationTable;
for (i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
var ctx = data[i]; var ctx = data[i];
// invite, requestInvite, friendRequest
if (ctx.senderUserId !== API.currentUser.id) { if (ctx.senderUserId !== API.currentUser.id) {
arr.push({ arr.push({
...ctx, ...ctx,
@@ -3493,17 +3493,22 @@ speechSynthesis.getVoices();
}); });
} }
} }
// TrustLevel, Friend, FriendRequest, Unfriend, DisplayName
var { data } = this.friendLogTable; var { data } = this.friendLogTable;
var j = this.friendLogTable.data.length; var i = data.length;
for (i = j - 1; i >= j - ((j > 10) ? 10 : j); i--) { var j = 0;
var ctx = data[i]; while (j < 10) {
if (i <= 0) {
break;
}
var ctx = data[--i];
// TrustLevel, Friend, FriendRequest, Unfriend, DisplayName
if (ctx.type !== 'FriendRequest') { if (ctx.type !== 'FriendRequest') {
arr.push({ arr.push({
...ctx, ...ctx,
isFriend: this.friends.has(ctx.userId), isFriend: this.friends.has(ctx.userId),
isFavorite: API.cachedFavoritesByObjectId.has(ctx.userId) isFavorite: API.cachedFavoritesByObjectId.has(ctx.userId)
}); });
++j;
} }
} }
arr.sort(function (a, b) { arr.sort(function (a, b) {
+1 -1
View File
@@ -847,7 +847,7 @@ speechSynthesis.getVoices();
break; break;
} }
if ((feedItem.created_at < bias) || (feedItem.type === 'Location') || if ((feedItem.created_at < bias) || (feedItem.type === 'Location') ||
((feedItem.type === 'GPS') && (feedItem.location !== ctx.location[0]) && ((feedItem.type === 'GPS') && (feedItem.created_at !== ctx.created_at) &&
(feedItem.displayName === ctx.displayName))) { (feedItem.displayName === ctx.displayName))) {
break; break;
} }