diff --git a/src/plugins/consoleJanitor/index.tsx b/src/plugins/consoleJanitor/index.tsx index bb2731552..f01be7791 100644 --- a/src/plugins/consoleJanitor/index.tsx +++ b/src/plugins/consoleJanitor/index.tsx @@ -164,12 +164,10 @@ export default definePlugin({ }, { find: "RPCServer:WSS", - replacement: [ - { - match: /\i\.error\(`Error: \$\{(\i)\.message\}/, - replace: '!$1.message.includes("EADDRINUSE")&&$&' - } - ] + replacement: { + match: /\i\.error\(`Error: \$\{(\i)\.message\}/, + replace: '!$1.message.includes("EADDRINUSE")&&$&' + } }, { find: "Tried getting Dispatch instance before instantiated", diff --git a/src/plugins/disableCallIdle/index.ts b/src/plugins/disableCallIdle/index.ts index 5a1ac84fe..216f1218c 100644 --- a/src/plugins/disableCallIdle/index.ts +++ b/src/plugins/disableCallIdle/index.ts @@ -25,18 +25,20 @@ export default definePlugin({ authors: [Devs.Nuckyz], patches: [ { - find: "#{intl::BOT_CALL_IDLE_DISCONNECT_2}", + find: "this.idleTimeout.start(", replacement: { - match: /,?(?=\i\(this,"idleTimeout",new \i\.\i\))/, - replace: ";return;" + match: /this\.idleTimeout\.(start|stop)/g, + replace: "$self.noop" } }, { find: "handleIdleUpdate(){", replacement: { - match: /(?<=_initialize\(\){)/, - replace: "return;" + match: "handleIdleUpdate(){", + replace: "handleIdleUpdate(){return;" } } - ] + ], + + noop() { } }); diff --git a/src/plugins/mentionAvatars/index.tsx b/src/plugins/mentionAvatars/index.tsx index 829f49e8e..b87995c8b 100644 --- a/src/plugins/mentionAvatars/index.tsx +++ b/src/plugins/mentionAvatars/index.tsx @@ -52,12 +52,10 @@ export default definePlugin({ patches: [{ // HEY THOR UPDATE SHOW ME YOUR NAME IF THIS SHIT CHANGES TY :) find: ".USER_MENTION)", - replacement: [ - { - match: /children:`@\$\{(\i\?\?\i)\}`(?<=\.useName\((\i)\).+?)/, - replace: "children:$self.renderUsername({username:$1,user:$2,showMeYourNameMention:typeof showMeYourNameMention!=='undefined'?showMeYourNameMention:undefined})" - } - ] + replacement: { + match: /children:`@\$\{(\i\?\?\i)\}`(?<=\.useName\((\i)\).+?)/, + replace: "children:$self.renderUsername({username:$1,user:$2,showMeYourNameMention:typeof showMeYourNameMention!=='undefined'?showMeYourNameMention:undefined})" + } }, { find: ".ROLE_MENTION)", diff --git a/src/plugins/pinDms/components/CreateCategoryModal.tsx b/src/plugins/pinDms/components/CreateCategoryModal.tsx index 4543fa6aa..11ec6462b 100644 --- a/src/plugins/pinDms/components/CreateCategoryModal.tsx +++ b/src/plugins/pinDms/components/CreateCategoryModal.tsx @@ -26,8 +26,7 @@ interface ColorPickerWithSwatchesProps { const ColorPickerWithSwatches = findComponentByCodeLazy('id:"color-picker"'); -// 701663 this is terrible imo -export const requireSettingsMenu = extractAndLoadChunksLazy(['"AppSkeleton"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}\}\),(?=.{0,15}createPromise.*?\}\),)/); +export const requireSettingsModal = extractAndLoadChunksLazy(['type:"USER_SETTINGS_MODAL_OPEN"']); const cl = classNameFactory("vc-pindms-modal-"); @@ -122,6 +121,6 @@ export function NewCategoryModal({ categoryId, modalProps, initialChannelId }: P export const openCategoryModal = (categoryId: string | null, channelId: string | null) => openModalLazy(async () => { - await requireSettingsMenu(); + await requireSettingsModal(); return modalProps => ; }); diff --git a/src/plugins/pinDms/data.ts b/src/plugins/pinDms/data.ts index 4c21f68c7..aa13fe645 100644 --- a/src/plugins/pinDms/data.ts +++ b/src/plugins/pinDms/data.ts @@ -16,11 +16,6 @@ export interface Category { collapsed?: boolean; } -const CATEGORY_BASE_KEY = "PinDMsCategories-"; -const CATEGORY_MIGRATED_PINDMS_KEY = "PinDMsMigratedPinDMs"; -const CATEGORY_MIGRATED_KEY = "PinDMsMigratedOldCategories"; -const OLD_CATEGORY_KEY = "BetterPinDMsCategories-"; - let forceUpdateDms: (() => void) | undefined = undefined; export let currentUserCategories: Category[] = []; diff --git a/src/plugins/pinDms/index.tsx b/src/plugins/pinDms/index.tsx index 7559abaa9..1fde12481 100644 --- a/src/plugins/pinDms/index.tsx +++ b/src/plugins/pinDms/index.tsx @@ -16,7 +16,7 @@ import { findCssClassesLazy, findStoreLazy } from "@webpack"; import { Clickable, ContextMenuApi, FluxDispatcher, Menu, React } from "@webpack/common"; import { contextMenus } from "./components/contextMenu"; -import { openCategoryModal, requireSettingsMenu } from "./components/CreateCategoryModal"; +import { openCategoryModal, requireSettingsModal } from "./components/CreateCategoryModal"; import { DEFAULT_CHUNK_SIZE } from "./constants"; import { canMoveCategory, canMoveCategoryInDirection, Category, categoryLen, collapseCategory, getAllUncollapsedChannels, getCategoryByIndex, getSections, init, isPinned, moveCategory, removeCategory, usePinnedDms } from "./data"; @@ -173,7 +173,7 @@ export default definePlugin({ categoryLen, getSections, getAllUncollapsedChannels, - requireSettingsMenu, + requireSettingsMenu: requireSettingsModal, makeProps(instance, { sections }: { sections: number[]; }) { this._instance = instance; diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 6ef86c425..43a270a5b 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -352,13 +352,6 @@ export default definePlugin({ match: /\i>0(?=&&!\i&&!\i)/, replace: m => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)?true:${m})` }, - { - // Show only the plus text without overflowed children amount - // if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen - match: /(?<=`\+\$\{)\i(?=\})/, - replace: overflowTextAmount => "" + - `$self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&(${overflowTextAmount}-1)<=0?"":${overflowTextAmount}` - }, { // Show only the plus text without overflowed children amount // if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen diff --git a/src/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx index ee678ed2d..5dc2d0eda 100644 --- a/src/plugins/viewIcons/index.tsx +++ b/src/plugins/viewIcons/index.tsx @@ -205,12 +205,10 @@ export default definePlugin({ // Banners { find: 'backgroundColor:"COMPLETE"', - replacement: [ - { - match: /(overflow:"visible",.{0,125}?!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?`url\(\$\{\2\}\))/, - replace: (_, rest, bannerSrc) => `${rest}onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,` - } - ] + replacement: { + match: /(overflow:"visible",.{0,125}?!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?`url\(\$\{\2\}\))/, + replace: (_, rest, bannerSrc) => `${rest}onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,` + } }, // Group DMs top small & large icon {