mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-14 17:13:03 -04:00
Resolve PluginSettings circular deps better
This commit is contained in:
parent
a525cd0113
commit
b3819228ed
3 changed files with 20 additions and 16 deletions
|
@ -23,6 +23,7 @@ import DonateButton from "@components/DonateButton";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { Heart } from "@components/Heart";
|
||||
import { openContributorModal } from "@components/PluginSettings/ContributorModal";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { Margins } from "@utils/margins";
|
||||
import { isPluginDev } from "@utils/misc";
|
||||
|
@ -37,12 +38,7 @@ const ContributorBadge: ProfileBadge = {
|
|||
image: CONTRIBUTOR_BADGE,
|
||||
position: BadgePosition.START,
|
||||
shouldShow: ({ user }) => isPluginDev(user.id),
|
||||
onClick(_, { user }) {
|
||||
// circular import shenanigans
|
||||
const { openContributorModal } = require("@components/PluginSettings/ContributorModal") as typeof import("@components/PluginSettings/ContributorModal");
|
||||
// setImmediate is needed to run on later tick to workaround limitation in proxyLazy
|
||||
setImmediate(() => openContributorModal(user));
|
||||
}
|
||||
onClick: (_, { user }) => openContributorModal(user)
|
||||
};
|
||||
|
||||
let DonorBadges = {} as Record<string, Array<Record<"tooltip" | "badge", string>>>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue