aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/imageZoom/index.tsx
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2023-04-11 02:00:42 +0200
committerVendicated <vendicated@riseup.net>2023-04-11 02:00:42 +0200
commit358eb6ad8eaf86fc96494f0e36216608e0023357 (patch)
treec7d89cff7b0fdca56373fb7b04f1c9cde7402389 /src/plugins/imageZoom/index.tsx
parentc997cb4958d2bc34103fa32b0a1a72824c16bd94 (diff)
downloadVencord-358eb6ad8eaf86fc96494f0e36216608e0023357.tar.gz
Vencord-358eb6ad8eaf86fc96494f0e36216608e0023357.tar.bz2
Vencord-358eb6ad8eaf86fc96494f0e36216608e0023357.zip
ImageZoom Fixes
Diffstat (limited to 'src/plugins/imageZoom/index.tsx')
-rw-r--r--src/plugins/imageZoom/index.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/imageZoom/index.tsx b/src/plugins/imageZoom/index.tsx
index 7a1887b..6014756 100644
--- a/src/plugins/imageZoom/index.tsx
+++ b/src/plugins/imageZoom/index.tsx
@@ -16,10 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import "./styles.css";
-
import { addContextMenuPatch, NavContextMenuPatchCallback, removeContextMenuPatch } from "@api/ContextMenu";
import { definePluginSettings } from "@api/settings";
+import { disableStyle, enableStyle } from "@api/Styles";
import { makeRange } from "@components/PluginSettings/components";
import { Devs } from "@utils/constants";
import { debounce } from "@utils/debounce";
@@ -29,6 +28,7 @@ import type { Root } from "react-dom/client";
import { Magnifier, MagnifierProps } from "./components/Magnifier";
import { ELEMENT_ID } from "./constants";
+import styles from "./styles.css?managed";
export const settings = definePluginSettings({
saveZoomValues: {
@@ -219,6 +219,7 @@ export default definePlugin({
},
start() {
+ enableStyle(styles);
addContextMenuPatch("image-context", imageContextMenuPatch);
this.element = document.createElement("div");
this.element.classList.add("MagnifierContainer");
@@ -226,6 +227,7 @@ export default definePlugin({
},
stop() {
+ disableStyle(styles);
// so componenetWillUnMount gets called if Magnifier component is still alive
this.root && this.root.unmount();
this.element?.remove();