mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-05 14:26:06 +02:00
Improve Friend List Loading Speed (#1116)
This commit is contained in:
+3
-6
@@ -5555,12 +5555,9 @@ console.log(`isLinux: ${LINUX}`);
|
|||||||
await $app.feedTableLookup();
|
await $app.feedTableLookup();
|
||||||
// eslint-disable-next-line require-atomic-updates
|
// eslint-disable-next-line require-atomic-updates
|
||||||
$app.notificationTable.data = await database.getNotifications();
|
$app.notificationTable.data = await database.getNotifications();
|
||||||
await this.refreshNotifications();
|
this.refreshNotifications();
|
||||||
await $app.loadCurrentUserGroups(
|
$app.loadCurrentUserGroups(args.json.id, args.json?.presence?.groups);
|
||||||
args.json.id,
|
$app.getCurrentUserGroups();
|
||||||
args.json?.presence?.groups
|
|
||||||
);
|
|
||||||
await $app.getCurrentUserGroups();
|
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
await configRepository.getBool(`friendLogInit_${args.json.id}`)
|
await configRepository.getBool(`friendLogInit_${args.json.id}`)
|
||||||
|
|||||||
@@ -2084,27 +2084,29 @@ export default class extends baseClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (groups) {
|
if (groups) {
|
||||||
for (var i = 0; i < groups.length; i++) {
|
const promises = groups.map(async (groupId) => {
|
||||||
var groupId = groups[i];
|
const groupRef = API.cachedGroups.get(groupId);
|
||||||
var groupRef = API.cachedGroups.get(groupId);
|
|
||||||
if (
|
if (
|
||||||
typeof groupRef !== 'undefined' &&
|
typeof groupRef !== 'undefined' &&
|
||||||
groupRef.myMember?.roleIds?.length > 0
|
groupRef.myMember?.roleIds?.length > 0
|
||||||
) {
|
) {
|
||||||
continue;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var args = await API.getGroup({
|
const args = await API.getGroup({
|
||||||
groupId,
|
groupId,
|
||||||
includeRoles: true
|
includeRoles: true
|
||||||
});
|
});
|
||||||
var ref = API.applyGroup(args.json);
|
const ref = API.applyGroup(args.json);
|
||||||
API.currentUserGroups.set(groupId, ref);
|
API.currentUserGroups.set(groupId, ref);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
|
await Promise.allSettled(promises);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.currentUserGroupsInit = true;
|
this.currentUserGroupsInit = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user