ServerInfo: fix Blocked & Ignored tabs

This commit is contained in:
Vendicated 2025-06-19 22:50:53 +02:00
parent 96516f113a
commit ba76c43a26
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 13 additions and 9 deletions

View file

@ -220,12 +220,12 @@ function FriendsTab({ guild, setCount }: RelationshipProps) {
}
function BlockedUsersTab({ guild, setCount }: RelationshipProps) {
const blockedIds = Object.keys(RelationshipStore.getMutableRelationships()).filter(id => RelationshipStore.isBlocked(id));
const blockedIds = RelationshipStore.getBlockedIDs();
return UserList("blocked", guild, blockedIds, setCount);
}
function IgnoredUserTab({ guild, setCount }: RelationshipProps) {
const ignoredIds = Object.keys(RelationshipStore.getMutableRelationships()).filter(id => RelationshipStore.isIgnored(id));
const ignoredIds = RelationshipStore.getIgnoredIDs();
return UserList("ignored", guild, ignoredIds, setCount);
}

View file

@ -236,17 +236,21 @@ export type useStateFromStores = <T>(
export class RelationshipStore extends FluxStore {
getFriendIDs(): string[];
/** Related to friend nicknames experiment. */
getNickname(userId: string): string;
getIgnoredIDs(): string[];
getBlockedIDs(): string[];
getPendingCount(): number;
getRelationshipCount(): number;
/** Related to friend nicknames. */
getNickname(userId: string): string;
/** @returns Enum value from constants.RelationshipTypes */
getRelationshipType(userId: string): number;
isFriend(userId: string): boolean;
isBlocked(userId: string): boolean;
isIgnored(userId: string): boolean;
getSince(userId: string): string;
/** @returns Format: [userId: Enum value from constants.RelationshipTypes] */
getMutableRelationships(): Record<number, number>;
isBlocked(userId: string): boolean;
isFriend(userId: string): boolean;
getSince(userId: string): string;
isIgnored(userId: string): boolean;
}