Merge branch 'dev' into immediate-finds-modules-proxy
This commit is contained in:
commit
a8f77a12df
|
@ -19,16 +19,11 @@
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { find } from "@webpack";
|
|
||||||
import { Constants, GuildStore, i18n, RestAPI } from "@webpack/common";
|
import { Constants, GuildStore, i18n, RestAPI } from "@webpack/common";
|
||||||
|
|
||||||
const InvitesDisabledExperiment = find(m => m.definition?.id === "2022-07_invites_disabled");
|
|
||||||
|
|
||||||
function showDisableInvites(guildId: string) {
|
function showDisableInvites(guildId: string) {
|
||||||
// Once the experiment is removed, this should keep working
|
|
||||||
const { enableInvitesDisabled } = InvitesDisabledExperiment?.getCurrentConfig?.({ guildId }) ?? { enableInvitesDisabled: true };
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return enableInvitesDisabled && !GuildStore.getGuild(guildId).hasFeature("INVITES_DISABLED");
|
return !GuildStore.getGuild(guildId).hasFeature("INVITES_DISABLED");
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableInvites(guildId: string) {
|
function disableInvites(guildId: string) {
|
||||||
|
|
|
@ -51,7 +51,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: "2022-07_invites_disabled",
|
find: "INVITES_DISABLED))||",
|
||||||
predicate: () => settings.store.showInvitesPaused,
|
predicate: () => settings.store.showInvitesPaused,
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\i\.\i\.can\(\i\.\i.MANAGE_GUILD,\i\)/,
|
match: /\i\.\i\.can\(\i\.\i.MANAGE_GUILD,\i\)/,
|
||||||
|
|
Loading…
Reference in a new issue