mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-28 16:04:24 -04:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
81e5b5b6b4
4 changed files with 21 additions and 12 deletions
|
@ -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))"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
18
src/webpack/common/types/stores.d.ts
vendored
18
src/webpack/common/types/stores.d.ts
vendored
|
@ -275,17 +275,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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue