diff --git a/src/plugins/serverInfo/GuildInfoModal.tsx b/src/plugins/serverInfo/GuildInfoModal.tsx index 8300380d..44f10afa 100644 --- a/src/plugins/serverInfo/GuildInfoModal.tsx +++ b/src/plugins/serverInfo/GuildInfoModal.tsx @@ -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); } diff --git a/src/webpack/common/types/stores.d.ts b/src/webpack/common/types/stores.d.ts index 497de739..cb06ca4b 100644 --- a/src/webpack/common/types/stores.d.ts +++ b/src/webpack/common/types/stores.d.ts @@ -236,17 +236,21 @@ export type useStateFromStores = ( 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; - isBlocked(userId: string): boolean; - isFriend(userId: string): boolean; - - getSince(userId: string): string; - isIgnored(userId: string): boolean; }