diff --git a/src/components/settings/tabs/patchHelper/FullPatchInput.tsx b/src/components/settings/tabs/patchHelper/FullPatchInput.tsx index f4db51a19..68ec174c6 100644 --- a/src/components/settings/tabs/patchHelper/FullPatchInput.tsx +++ b/src/components/settings/tabs/patchHelper/FullPatchInput.tsx @@ -46,7 +46,7 @@ export function FullPatchInput({ setFind, setParsedFind, setMatch, setReplacemen } if (!replacement.match) throw new Error("No 'replacement.match' field"); - if (!replacement.replace) throw new Error("No 'replacement.replace' field"); + if (replacement.replace == null) throw new Error("No 'replacement.replace' field"); setFind(find instanceof RegExp ? `/${find.source}/` : find); setParsedFind(find); diff --git a/src/plugins/fixImagesQuality/README.md b/src/plugins/fixImagesQuality/README.md index 8e3cf6548..b0830abf4 100644 --- a/src/plugins/fixImagesQuality/README.md +++ b/src/plugins/fixImagesQuality/README.md @@ -1,3 +1,5 @@ # Fix Images Quality -Prevents images from being loaded as webp, which can cause quality loss +Improves quality of images in chat by forcing png format. + +This plugin does not change how others see your images! diff --git a/src/plugins/fixImagesQuality/index.ts b/src/plugins/fixImagesQuality/index.ts index b62d3c7bc..f1b8045de 100644 --- a/src/plugins/fixImagesQuality/index.ts +++ b/src/plugins/fixImagesQuality/index.ts @@ -9,14 +9,14 @@ import definePlugin from "@utils/types"; export default definePlugin({ name: "FixImagesQuality", - description: "Prevents images from being loaded as webp, which can cause quality loss", + description: "Improves quality of images in chat by forcing png format", authors: [Devs.Nuckyz], patches: [ { find: ".handleImageLoad)", replacement: { - match: /(?<=null;return )\i\.\i&&\(\i\|\|!\i\.isAnimated.+?:(?=\i&&\(\i="png"\))/, - replace: "" + match: /(?<=\i=)"webp"/, + replace: '"png"' } } ]