Fix Broken Patches

This commit is contained in:
thororen1234 2025-01-15 23:20:57 -05:00
parent 3994eaf489
commit 2432364123
2 changed files with 6 additions and 6 deletions

View file

@ -76,7 +76,7 @@ export default definePlugin({
{ {
find: "useGenerateUserSettingsSections", find: "useGenerateUserSettingsSections",
replacement: { replacement: {
match: /(\.FRIEND_REQUESTS)/, match: /(\.CLIPS)/,
replace: "$1,\"SCAN_QR_CODE\"" replace: "$1,\"SCAN_QR_CODE\""
} }
}, },

View file

@ -34,19 +34,19 @@ export default definePlugin({
{ {
find: "#{intl::STICKER_BUTTON_LABEL}", find: "#{intl::STICKER_BUTTON_LABEL}",
replacement: [{ replacement: [{
match: /(children:\(0,\w\.jsx\)\()([\w.]+?)(,{innerClassName.{10,30}\.stickerButton)/, match: /(children:\(0,\i\.jsx\)\()([\w.]+?)(,{innerClassName.{10,30}\.stickerButton)/,
replace: (_, head, button, tail) => { replace: (_, head, button, tail) => {
const isMoreStickers = "arguments[0]?.stickersType"; const isMoreStickers = "arguments[0]?.stickersType";
return `${head}${isMoreStickers}?$self.stickerButton:${button}${tail}`; return `${head}${isMoreStickers}?$self.stickerButton:${button}${tail}`;
} }
}, { }, {
match: /(\w=)(\w\.useCallback\(\(\)=>\{\(0,\w+\.\w+\)\([\w.]*?\.STICKER,.*?);/, match: /(\i=)(\i\.useCallback\(\(\)=>\{\(0,\w+\.\w+\)\([\w.]*?\.STICKER,.*?);/,
replace: (_, decl, cb) => { replace: (_, decl, cb) => {
const newCb = cb.replace(/(?<=\(\)=>\{\(.*?\)\().+?\.STICKER/, "\"stickers+\""); const newCb = cb.replace(/(?<=\(\)=>\{\(.*?\)\().+?\.STICKER/, "\"stickers+\"");
return `${decl}arguments[0]?.stickersType?${newCb}:${cb};`; return `${decl}arguments[0]?.stickersType?${newCb}:${cb};`;
} }
}, { }, {
match: /(\w)=((\w)===\w+?\.\w+?\.STICKER)/, match: /(\i)=((\i)===\w+?\.\w+?\.STICKER)/,
replace: (_, isActive, isStickerTab, currentTab) => { replace: (_, isActive, isStickerTab, currentTab) => {
const c = "arguments[0].stickersType"; const c = "arguments[0].stickersType";
return `${isActive}=${c}?(${currentTab}===${c}):(${isStickerTab})`; return `${isActive}=${c}?(${currentTab}===${c}):(${isStickerTab})`;
@ -56,7 +56,7 @@ export default definePlugin({
{ {
find: ".gifts)", find: ".gifts)",
replacement: { replacement: {
match: /,\(null===\(\w=\w\.stickers\)\|\|void 0.*?(\w)\.push\((\(0,\w\.jsx\))\((.+?),{disabled:\w,type:(\w)},"sticker"\)\)/, match: /\(null===\(\i=\i\.stickers\).*?(\i)\.push\((\(0,\i\.jsx\))\((.+?),{disabled:\w,type:(\i)},"sticker"\)\)/,
replace: (m, _, jsx, compo, type) => { replace: (m, _, jsx, compo, type) => {
const c = "arguments[0].type"; const c = "arguments[0].type";
return `${m},${c}?.submit?.button&&${_}.push(${jsx}(${compo},{disabled:!${c}?.submit?.button,type:${type},stickersType:"stickers+"},"stickers+"))`; return `${m},${c}?.submit?.button&&${_}.push(${jsx}(${compo},{disabled:!${c}?.submit?.button,type:${type},stickersType:"stickers+"},"stickers+"))`;
@ -87,7 +87,7 @@ export default definePlugin({
{ {
find: '==="remove_text"', find: '==="remove_text"',
replacement: { replacement: {
match: /,\w\.insertText=\w=>{[\w ;]*?1===\w\.length&&.+?==="remove_text"/, match: /,\i\.insertText=\i=>{[\w ;]*?1===\i\.length&&.+?==="remove_text"/,
replace: ",$self.textEditor=arguments[0]$&" replace: ",$self.textEditor=arguments[0]$&"
} }
} }