From e34da54271ed8027d337a484f0ec00749c71a53b Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Wed, 12 Apr 2023 23:22:38 -0300 Subject: Option to transform emotes/stickers in compound messages (#876) + ContextMenu refactor to not call callbacks for same children multiple times Co-authored-by: V --- src/plugins/imageZoom/index.tsx | 98 ++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 50 deletions(-) (limited to 'src/plugins/imageZoom/index.tsx') diff --git a/src/plugins/imageZoom/index.tsx b/src/plugins/imageZoom/index.tsx index 6014756..d65df08 100644 --- a/src/plugins/imageZoom/index.tsx +++ b/src/plugins/imageZoom/index.tsx @@ -76,56 +76,54 @@ export const settings = definePluginSettings({ const imageContextMenuPatch: NavContextMenuPatchCallback = (children, _) => { - if (!children.some(child => child?.props?.id === "image-zoom")) { - children.push( - - {/* thanks SpotifyControls */} - ( - settings.store.zoom = value, 100)} - /> - )} - /> - ( - settings.store.size = value, 100)} - /> - )} - /> - ( - settings.store.zoomSpeed = value, 100)} - renderValue={(value: number) => `${value.toFixed(3)}x`} - /> - )} - /> - - ); - } + children.push( + + {/* thanks SpotifyControls */} + ( + settings.store.zoom = value, 100)} + /> + )} + /> + ( + settings.store.size = value, 100)} + /> + )} + /> + ( + settings.store.zoomSpeed = value, 100)} + renderValue={(value: number) => `${value.toFixed(3)}x`} + /> + )} + /> + + ); }; export default definePlugin({ -- cgit