aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/viewIcons.tsx
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-11-06 18:37:01 +0100
committerVendicated <vendicated@riseup.net>2022-11-06 18:37:01 +0100
commit963a7332b4daa183ec2d8d3ddf10f3f73b01746a (patch)
tree6eaecd2af5bc67222eb9748c7bf948fbf3c17a1a /src/plugins/viewIcons.tsx
parent440baf6028be926929497c14e9ab4610cddd255d (diff)
downloadVencord-963a7332b4daa183ec2d8d3ddf10f3f73b01746a.tar.gz
Vencord-963a7332b4daa183ec2d8d3ddf10f3f73b01746a.tar.bz2
Vencord-963a7332b4daa183ec2d8d3ddf10f3f73b01746a.zip
Migrate proxied components to and fix LazyComponent
Diffstat (limited to 'src/plugins/viewIcons.tsx')
-rw-r--r--src/plugins/viewIcons.tsx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/viewIcons.tsx b/src/plugins/viewIcons.tsx
index 3ea9afa..bd70bd6 100644
--- a/src/plugins/viewIcons.tsx
+++ b/src/plugins/viewIcons.tsx
@@ -17,14 +17,13 @@
*/
import { Devs } from "../utils/constants";
-import { lazyWebpack, makeLazy } from "../utils/misc";
+import { LazyComponent } from "../utils/misc";
import { ModalRoot, ModalSize, openModal } from "../utils/modal";
import definePlugin from "../utils/types";
import { find } from "../webpack";
-import { React } from "../webpack/common";
-const ImageModal = lazyWebpack(m => m.prototype?.render?.toString().includes("OPEN_ORIGINAL_IMAGE"));
-const getMaskedLink = makeLazy(() => find(m => m.type?.toString().includes("MASKED_LINK)")));
+const ImageModal = LazyComponent(() => find(m => m.prototype?.render?.toString().includes("OPEN_ORIGINAL_IMAGE")));
+const MaskedLink = LazyComponent(() => find(m => m.type?.toString().includes("MASKED_LINK)")));
const OPEN_URL = "Vencord.Plugins.plugins.ViewIcons.openImage(";
export default definePlugin({
@@ -39,7 +38,7 @@ export default definePlugin({
shouldAnimate={true}
original={url}
src={url}
- renderLinkComponent={props => React.createElement(getMaskedLink(), props)}
+ renderLinkComponent={() => <MaskedLink />}
/>
</ModalRoot>
));