From 563688e2b1540f4d63e9dc223358e43650cd523d Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:10:21 -0400 Subject: [PATCH] CharacterCounter: Fix Bug --- src/plugins/characterCounter/index.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/characterCounter/index.tsx b/src/plugins/characterCounter/index.tsx index 0aace6c77..6bff79c50 100644 --- a/src/plugins/characterCounter/index.tsx +++ b/src/plugins/characterCounter/index.tsx @@ -11,11 +11,9 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { Devs, EquicordDevs } from "@utils/constants"; import { classNameFactory } from "@utils/css"; import definePlugin, { OptionType } from "@utils/types"; -import { findByPropsLazy } from "@webpack"; import { useEffect, UserStore, useState } from "@webpack/common"; const cl = classNameFactory("vc-charCounter-"); -const SlateUtils = findByPropsLazy("getSelectedText"); const settings = definePluginSettings({ colorEffects: { @@ -66,7 +64,7 @@ export default definePlugin({ const listener = () => { if (!editorRef?.current) return setSelectedCount(0); - setTimeout(() => setSelectedCount(SlateUtils.getSelectedText(editorRef.current?.getSlateEditor())?.length ?? 0), 50); + setSelectedCount(document.getSelection()?.toString()?.length ?? 0); }; document.addEventListener("selectionchange", listener);