mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 14:23:51 +02:00
Mutual friends tab
This commit is contained in:
@@ -170,7 +170,7 @@ function compareByLastActive(a, b) {
|
||||
b.ref?.$online_for &&
|
||||
a.ref.$online_for === b.ref.$online_for
|
||||
) {
|
||||
compareByActivityField(a, b, 'last_login');
|
||||
return compareByActivityField(a, b, 'last_login');
|
||||
}
|
||||
return compareByActivityField(a, b, '$online_for');
|
||||
}
|
||||
@@ -178,6 +178,16 @@ function compareByLastActive(a, b) {
|
||||
return compareByActivityField(a, b, 'last_activity');
|
||||
}
|
||||
|
||||
function compareByLastActiveRef(a, b) {
|
||||
if (a.state === 'online' && b.state === 'online') {
|
||||
if (a.$online_for && b.$online_for && a.$online_for === b.$online_for) {
|
||||
return a.last_login < b.last_login ? 1 : -1;
|
||||
}
|
||||
return a.$online_for < b.$online_for ? 1 : -1;
|
||||
}
|
||||
return a.last_activity < b.last_activity ? 1 : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* last seen
|
||||
* @param {object} a
|
||||
@@ -259,6 +269,19 @@ function compareByLocation(a, b) {
|
||||
return a.ref.location.localeCompare(b.ref.location);
|
||||
}
|
||||
|
||||
/**
|
||||
* $friendNumber friend order
|
||||
* @param {object} a
|
||||
* @param {object} b
|
||||
* @returns
|
||||
*/
|
||||
function compareByFriendOrder(a, b) {
|
||||
if (typeof a === 'undefined' || typeof b === 'undefined') {
|
||||
return 0;
|
||||
}
|
||||
return b.$friendNumber - a.$friendNumber;
|
||||
}
|
||||
|
||||
export {
|
||||
compareByName,
|
||||
compareByCreatedAt,
|
||||
@@ -270,7 +293,9 @@ export {
|
||||
compareByPrivate,
|
||||
compareByStatus,
|
||||
compareByLastActive,
|
||||
compareByLastActiveRef,
|
||||
compareByLastSeen,
|
||||
compareByLocationAt,
|
||||
compareByLocation
|
||||
compareByLocation,
|
||||
compareByFriendOrder
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user