Mutual friends on friendsList

This commit is contained in:
Natsumi
2025-11-20 16:30:26 +11:00
parent b0621c04b8
commit 506b709a21
7 changed files with 82 additions and 4 deletions
+11
View File
@@ -915,6 +915,16 @@ export const useFriendStore = defineStore('Friend', () => {
}
}
async function getAllUserMutualCount() {
const mutualCountMap = await database.getMutualCountForAllUsers();
for (const [userId, mutualCount] of mutualCountMap.entries()) {
const ref = friends.get(userId);
if (ref?.ref) {
ref.ref.$mutualCount = mutualCount;
}
}
}
/**
*
* @param {string} id
@@ -1625,6 +1635,7 @@ export const useFriendStore = defineStore('Friend', () => {
refreshFriendsList,
updateOnlineFriendCounter,
getAllUserStats,
getAllUserMutualCount,
initFriendLog,
migrateFriendLog,
getFriendLog,
+1
View File
@@ -523,6 +523,7 @@ export const useUserStore = defineStore('User', () => {
$joinCount: 0,
$timeSpent: 0,
$lastSeen: '',
$mutualCount: 0,
$nickName: '',
$previousLocation: '',
$customTag: '',