Skip to content

Commit

Permalink
Fix Patch for Group DMs and Memory Leak
Browse files Browse the repository at this point in the history
  • Loading branch information
domi-btnr committed Jun 29, 2024
1 parent 9284661 commit 9337129
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions PlatformIndicators/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default class PlatformIndicators {
Patcher.after(ChannelWrapper, Key_CW, (_, __, res) => {
if (!Settings.get("showInDmsList", true)) return;
Patcher.after(res, "type", (_, [props], res) => {
if (!props.user) return; // Its a group DM
if (Settings.get("ignoreBots", true) && props.user.bot) return;
return (
<UserContext.Provider value={props.user}>
Expand Down Expand Up @@ -123,7 +124,6 @@ export default class PlatformIndicators {
Patcher.after(BadgeList, Key_BL, (_, __, res) => {
const user = React.useContext(UserContext);
if (!user) return;
if (Settings.get("ignoreBots", true) && user.bot) return;
res.props.children.push(
<StatusIndicators
userId={user.id}
Expand All @@ -144,7 +144,8 @@ export default class PlatformIndicators {

Patcher.after(UserInfo, key, (_, __, res) => {
if (!Settings.get("showInFriendsList", true)) return;
Patcher.after(res.props.children[1].props.children[0], "type", (_, [props], res) => {
const unpatch = Patcher.after(res.props.children[1].props.children[0], "type", (_, [props], res) => {
unpatch();
Patcher.after(res, "type", (_, __, res) => {
res.props.children.push(
<StatusIndicators
Expand Down
2 changes: 1 addition & 1 deletion PlatformIndicators/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "APlatformIndicators",
"version": "1.5.7",
"version": "1.5.8",
"author": "Strencher",
"authorId": "415849376598982656",
"description": "Adds indicators for every platform that the user is using.",
Expand Down

0 comments on commit 9337129

Please sign in to comment.