diff --git a/src/plugins/betterFolders/index.tsx b/src/plugins/betterFolders/index.tsx index c589824c..1164ac1b 100644 --- a/src/plugins/betterFolders/index.tsx +++ b/src/plugins/betterFolders/index.tsx @@ -182,7 +182,7 @@ export default definePlugin({ }, // If we are rendering the Better Folders sidebar, we filter out everything but the Guild List from the Sidebar children { - match: /unreadMentionsFixedFooter\].+?unreadMentionsBar\}\)\]/, + match: /unreadMentionsFixedFooter\].+?\}\)\]/, replace: "$&.filter($self.makeGuildsBarSidebarFilter(!!arguments[0]?.isBetterFolders))" } ] diff --git a/src/plugins/serverInfo/GuildInfoModal.tsx b/src/plugins/serverInfo/GuildInfoModal.tsx index 9920d8aa..40a0a1ab 100644 --- a/src/plugins/serverInfo/GuildInfoModal.tsx +++ b/src/plugins/serverInfo/GuildInfoModal.tsx @@ -255,12 +255,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/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx index 6c45a799..1f9b23e0 100644 --- a/src/plugins/viewIcons/index.tsx +++ b/src/plugins/viewIcons/index.tsx @@ -71,9 +71,14 @@ const openAvatar = (url: string) => openImage(url, 512, 512); const openBanner = (url: string) => openImage(url, 1024); function openImage(url: string, width: number, height?: number) { - const format = url.startsWith("/") ? "png" : settings.store.format; - const u = new URL(url, window.location.href); + + const format = url.startsWith("/") + ? "png" + : u.searchParams.get("animated") === "true" + ? "gif" + : settings.store.format; + u.searchParams.set("size", settings.store.imgSize); u.pathname = u.pathname.replace(/\.(png|jpe?g|webp)$/, `.${format}`); url = u.toString(); diff --git a/src/webpack/common/types/stores.d.ts b/src/webpack/common/types/stores.d.ts index b2e42f0e..d83a75da 100644 --- a/src/webpack/common/types/stores.d.ts +++ b/src/webpack/common/types/stores.d.ts @@ -275,17 +275,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; }