Moderations in playerList

This commit is contained in:
Natsumi
2025-08-21 05:07:06 +12:00
parent 7d06966fef
commit 887f59d2b4
9 changed files with 138 additions and 39 deletions
+28 -14
View File
@@ -440,6 +440,34 @@ export const useFriendStore = defineStore('Friend', () => {
if (typeof ref !== 'undefined') {
location = ref.location;
$location_at = ref.$location_at;
// wtf, fetch user if offline in an instance
if (
ctx.state !== 'online' &&
isRealInstance(ref.location) &&
ref.$lastFetch < Date.now() - 10000 // 10 seconds
) {
console.log(
`Fetching offline friend in an instance ${ctx.name}`
);
userRequest.getUser({
userId: id
});
}
// wtf, fetch user if online in an offline location
if (
ctx.state === 'online' &&
ref.location === 'offline' &&
ref.$lastFetch < Date.now() - 10000 // 10 seconds
) {
console.log(
`Fetching online friend in an offline location ${ctx.name}`
);
userRequest.getUser({
userId: id
});
return;
}
}
if (typeof stateInput === 'undefined' || ctx.state === stateInput) {
// this is should be: undefined -> user
@@ -489,20 +517,6 @@ export const useFriendStore = defineStore('Friend', () => {
state.sortOfflineFriends = true;
}
}
// wtf, fetch user if offline in an instance
if (
ctx.state !== 'online' &&
typeof ref !== 'undefined' &&
isRealInstance(ref.location) &&
ref.$lastFetch < Date.now() - 10000 // 10 seconds
) {
console.log(
`Fetching offline friend in an instance ${ctx.name}`
);
userRequest.getUser({
userId: id
});
}
} else if (
ctx.state === 'online' &&
(stateInput === 'active' || stateInput === 'offline')