mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 13:43:03 -04:00
Fix not respecting contributor badge preference (#3443)
This commit is contained in:
parent
76b1fe9a87
commit
b706d53998
2 changed files with 3 additions and 2 deletions
|
@ -27,7 +27,7 @@ import { openContributorModal } from "@components/PluginSettings/ContributorModa
|
|||
import { Devs } from "@utils/constants";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { Margins } from "@utils/margins";
|
||||
import { isPluginDev } from "@utils/misc";
|
||||
import { shouldShowContributorBadge } from "@utils/misc";
|
||||
import { closeModal, ModalContent, ModalFooter, ModalHeader, ModalRoot, openModal } from "@utils/modal";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Forms, Toasts, UserStore } from "@webpack/common";
|
||||
|
@ -39,7 +39,7 @@ const ContributorBadge: ProfileBadge = {
|
|||
description: "Vencord Contributor",
|
||||
image: CONTRIBUTOR_BADGE,
|
||||
position: BadgePosition.START,
|
||||
shouldShow: ({ userId }) => isPluginDev(userId),
|
||||
shouldShow: ({ userId }) => shouldShowContributorBadge(userId),
|
||||
onClick: (_, { userId }) => openContributorModal(UserStore.getUser(userId))
|
||||
};
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ export function identity<T>(value: T): T {
|
|||
export const isMobile = navigator.userAgent.includes("Mobi");
|
||||
|
||||
export const isPluginDev = (id: string) => Object.hasOwn(DevsById, id);
|
||||
export const shouldShowContributorBadge = (id: string) => isPluginDev(id) && DevsById[id].badge !== false;
|
||||
|
||||
export function pluralise(amount: number, singular: string, plural = singular + "s") {
|
||||
return amount === 1 ? `${amount} ${singular}` : `${amount} ${plural}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue