From 024a77c577cb7b082c46ce24b0ee33851abface9 Mon Sep 17 00:00:00 2001 From: Jack Matthews Date: Wed, 25 Oct 2023 11:48:17 -0400 Subject: [PATCH] fix: typingIndicator --- src/plugins/typingIndicator/index.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/typingIndicator/index.tsx b/src/plugins/typingIndicator/index.tsx index 5f7df477..8ac34460 100644 --- a/src/plugins/typingIndicator/index.tsx +++ b/src/plugins/typingIndicator/index.tsx @@ -26,7 +26,12 @@ import { ChannelStore, GuildMemberStore, RelationshipStore, Tooltip, UserStore, import { buildSeveralUsers } from "../typingTweaks"; -const ThreeDots = LazyComponent(() => find(m => m.type?.render?.toString()?.includes("().dots"))); +const ThreeDots = LazyComponent(() => { + // This doesn't really need to explicitly find Dots' own module, but it's fine + const res = find(m => m.Dots && !m.Menu); + + return res?.Dots; +}); const TypingStore = findStoreLazy("TypingStore"); const UserGuildSettingsStore = findStoreLazy("UserGuildSettingsStore"); @@ -126,8 +131,8 @@ export default definePlugin({ { find: ".UNREAD_HIGHLIGHT", replacement: { - match: /\(\).children.+?:null(?<=(\i)=\i\.channel,.+?)/, - replace: (m, channel) => `${m},$self.TypingIndicator(${channel}.id)` + match: /channel:(\i).{0,100}?channelEmoji,.{0,250}?\.children.{0,50}?:null/, + replace: "$&,$self.TypingIndicator($1.id)" } } ],