From b9a56647401c37ef7542059398360428db67b344 Mon Sep 17 00:00:00 2001 From: chylex Date: Sat, 18 Jun 2022 13:54:31 +0200 Subject: [PATCH] Fix not seeing messages after a Discord update Closes #189 --- app/Resources/Tracker/scripts/discord.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Resources/Tracker/scripts/discord.js b/app/Resources/Tracker/scripts/discord.js index cb2c8d6..8b62b8a 100644 --- a/app/Resources/Tracker/scripts/discord.js +++ b/app/Resources/Tracker/scripts/discord.js @@ -91,11 +91,13 @@ class DISCORD { static getMessageElementProps(ele) { const props = DOM.getReactProps(ele); - if (props.children && props.children.length >= 4) { - const childProps = props.children[3].props; - - if ("message" in childProps && "channel" in childProps) { - return childProps; + if (props.children && props.children.length) { + for (let i = 3; i < props.children.length; i++) { + const childProps = props.children[i].props; + + if (childProps && "message" in childProps && "channel" in childProps) { + return childProps; + } } }