Co-authored-by: V <vendicated@riseup.net> Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com>
26 lines
776 B
TypeScript
26 lines
776 B
TypeScript
/*
|
|
* Vencord, a Discord client mod
|
|
* Copyright (c) 2024 Vendicated and contributors
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
import { Devs } from "@utils/constants";
|
|
import definePlugin from "@utils/types";
|
|
|
|
|
|
export default definePlugin({
|
|
name: "DynamicImageModalAPI",
|
|
authors: [Devs.sadan, Devs.Nuckyz],
|
|
description: "Allows you to omit either width or height when opening an image modal",
|
|
patches: [
|
|
{
|
|
// TODO: bundler compat
|
|
find: ".renderLinkComponent",
|
|
replacement: {
|
|
// widthAndHeightPassed = w != null && w !== 0 && h == null || h === 0
|
|
match: /(?<=\i=)(null!=\i&&0!==\i)&&(null!=\i&&0!==\i)/,
|
|
replace: "($1)||($2)"
|
|
}
|
|
}
|
|
]
|
|
});
|