Skip to content

Commit

Permalink
Fix ShowHiddenThings feature & PauseInvitesForever
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckyz committed Aug 13, 2024
1 parent 1a712e7 commit 4301ed8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/plugins/pauseInvitesForever/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,11 @@
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findLazy } from "@webpack";
import { Constants, GuildStore, i18n, RestAPI } from "@webpack/common";

const InvitesDisabledExperiment = findLazy(m => m.definition?.id === "2022-07_invites_disabled");

function showDisableInvites(guildId: string) {
// Once the experiment is removed, this should keep working
const { enableInvitesDisabled } = InvitesDisabledExperiment?.getCurrentConfig?.({ guildId }) ?? { enableInvitesDisabled: true };
// @ts-ignore
return enableInvitesDisabled && !GuildStore.getGuild(guildId).hasFeature("INVITES_DISABLED");
return !GuildStore.getGuild(guildId).hasFeature("INVITES_DISABLED");
}

function disableInvites(guildId: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/showHiddenThings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default definePlugin({
},
},
{
find: "2022-07_invites_disabled",
find: "INVITES_DISABLED))||",
predicate: () => settings.store.showInvitesPaused,
replacement: {
match: /\i\.\i\.can\(\i\.\i.MANAGE_GUILD,\i\)/,
Expand Down

0 comments on commit 4301ed8

Please sign in to comment.