From f6906a0bb76b4b23ee6aa400f763e16d0b89dfb1 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien <23700969+mwittrien@users.noreply.github.com> Date: Thu, 24 Mar 2022 15:53:16 +0100 Subject: [PATCH] Update ImageUtilities.plugin.js --- Plugins/ImageUtilities/ImageUtilities.plugin.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Plugins/ImageUtilities/ImageUtilities.plugin.js b/Plugins/ImageUtilities/ImageUtilities.plugin.js index cefd7a5b24..6626462fa7 100644 --- a/Plugins/ImageUtilities/ImageUtilities.plugin.js +++ b/Plugins/ImageUtilities/ImageUtilities.plugin.js @@ -2,7 +2,7 @@ * @name ImageUtilities * @author DevilBro * @authorId 278543574059057154 - * @version 4.6.8 + * @version 4.6.9 * @description Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.) * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,13 +17,8 @@ module.exports = (_ => { "info": { "name": "ImageUtilities", "author": "DevilBro", - "version": "4.6.8", + "version": "4.6.9", "description": "Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)" - }, - "changeLog": { - "improved": { - "Gallery Mode Channel Wide": "Gallery Mode now let's you move between all images/gifs in a channel, it will automatically load new images/gifs once you hit the last/first in the current queue" - } } }; @@ -892,7 +887,6 @@ module.exports = (_ => { else if (e.methodname == "componentWillUnmount") { firstViewedImage = null; viewedImage = null; - cachedImages = null; this.cleanupListeners("Gallery"); } else { @@ -1027,7 +1021,7 @@ module.exports = (_ => { } if (this.settings.viewerSettings.galleryMode && viewedImage) { - if (!cachedImages) { + if (!cachedImages || this.getImageIndex(cachedImages.all, viewedImage) == -1) { BDFDB.TimeUtils.clear(viewedImageTimeout); let channel = BDFDB.LibraryModules.ChannelStore.getChannel(viewedImage.channelId); BDFDB.LibraryModules.APIUtils.get({ @@ -1076,9 +1070,6 @@ module.exports = (_ => { }; BDFDB.ReactUtils.forceUpdate(e.instance); }); - return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Spinner, { - type: BDFDB.LibraryComponents.Spinner.Type.SPINNING_CIRCLE - }); } else { if (cachedImages.all[cachedImages.index - 1]) e.returnvalue.props.children.push(BDFDB.ReactUtils.createElement(LazyImageSiblingComponent, { @@ -1224,7 +1215,7 @@ module.exports = (_ => { e.instance.props.src = e.instance.props.src.replace(/width=\d+/, `width=${width}`).replace(/height=\d+/, `height=${height}`); e.instance.props.resized = true; } - if (this.settings.resizeSettings.messages && BDFDB.ReactUtils.findOwner(BDFDB.ObjectUtils.get(e, `instance.${BDFDB.ReactUtils.instanceKey}`), {name: "LazyImageZoomable", up: true})) { + if (this.settings.resizeSettings.messages && (!e.instance.props.className || e.instance.props.className.indexOf(BDFDB.disCN.embedmedia) == -1) && BDFDB.ReactUtils.findOwner(BDFDB.ObjectUtils.get(e, `instance.${BDFDB.ReactUtils.instanceKey}`), {name: "LazyImageZoomable", up: true})) { let aRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCN.appmount)); let mRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCNC.messageaccessory + BDFDB.dotCN.messagecontents)); let mwRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCN.messagewrapper));