fix(apiMessagePopover): fix match (#608)

This commit is contained in:
whqwert 2023-03-18 16:38:08 -05:00 committed by GitHub
parent 0b79387800
commit 5873bde6a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,7 +27,7 @@ export default definePlugin({
find: "Messages.MESSAGE_UTILITIES_A11Y_LABEL", find: "Messages.MESSAGE_UTILITIES_A11Y_LABEL",
replacement: { replacement: {
// foo && !bar ? createElement(blah,...makeElement(addReactionData)) // foo && !bar ? createElement(blah,...makeElement(addReactionData))
match: /(\i&&!\i)\?\(0,\i\.jsxs?\)\(.{0,20}renderPopout:.{0,300}?(\i)\(.{3,20}\{key:"add-reaction".+?\}/, match: /(\i&&!\i)\?\(0,\i\.jsxs?\)\(.{0,200}renderPopout:.{0,300}?(\i)\(.{3,20}\{key:"add-reaction".+?\}/,
replace: (m, bools, makeElement) => { replace: (m, bools, makeElement) => {
const msg = m.match(/message:(.{1,3}),/)?.[1]; const msg = m.match(/message:(.{1,3}),/)?.[1];
if (!msg) throw new Error("Could not find message variable"); if (!msg) throw new Error("Could not find message variable");