Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
5f2ce468bc
8 changed files with 24 additions and 41 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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() { }
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ interface ColorPickerWithSwatchesProps {
|
|||
|
||||
const ColorPickerWithSwatches = findComponentByCodeLazy<ColorPickerWithSwatchesProps>('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 => <NewCategoryModal categoryId={categoryId} modalProps={modalProps} initialChannelId={channelId} />;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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[] = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue