Skip to content

Commit

Permalink
Fix PlatformIndicators
Browse files Browse the repository at this point in the history
Fixes #439
  • Loading branch information
domi-btnr committed Feb 28, 2025
1 parent a92e67a commit ba8d7d0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@

node_modules
./**/node_modules
builds
./*.plugin.js
builds/
package-lock.json
pnpm-lock.yaml
14 changes: 7 additions & 7 deletions PlatformIndicators/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import {DOM, Patcher, ReactUtils, Webpack, Utils} from "@api";
import { DOM, Patcher, ReactUtils, Webpack, Utils } from "@api";
import manifest from "@manifest";
import Styles from "@styles";

Expand All @@ -8,7 +8,7 @@ import showChangelog from "../common/Changelog";
import StatusIndicators from "./components/indicators";
import SettingsPanel from "./components/settings";
import Settings from "./modules/settings";
import {findInReactTree} from "./modules/utils";
import { findInReactTree } from "./modules/utils";

export default class PlatformIndicators {
getSettingsPanel() {
Expand All @@ -31,7 +31,7 @@ export default class PlatformIndicators {
const [NameWrapper, Key_NW] = Webpack.getWithKey(x => x.toString().includes(".nameAndDecorators") && !x.toString().includes('"listitem"'));
const ChannelClasses = Webpack.getByKeys("channel", "decorator");

Patcher.after(ChannelWrapper, Key_CW, (_, __, res) => {
Patcher.after(ChannelWrapper, "ZP", (_, __, res) => {
if (!Settings.get("showInDmsList", true)) return;
Patcher.after(res, "type", (_, [props], res) => {
if (!props.user) return; // Its a group DM
Expand All @@ -53,11 +53,11 @@ export default class PlatformIndicators {

Patcher.after(NameWrapper, Key_NW, (_, __, res) => {
if (!Settings.get("showInDmsList", true)) return;

const user = React.useContext(UserContext);
if (!user) return;
const child = Utils.findInTree(res, e => e?.className?.includes("nameAndDecorators"));

const child = Utils.findInTree(res, e => e?.className?.includes("nameAndDecorators"), { walkable: ["children", "props"] });
if (!child) return;

child.children.push(
Expand All @@ -80,7 +80,7 @@ export default class PlatformIndicators {
const obj = findInReactTree(children, e => e?.avatar && e?.name);

if (obj)
children?.props?.children?.props?.decorators?.props?.children.push(
children?.props?.name?.props?.children?.props?.children?.push(
<StatusIndicators
userId={props.user.id}
type="MemberList"
Expand Down
6 changes: 3 additions & 3 deletions PlatformIndicators/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "APlatformIndicators",
"version": "1.5.12",
"version": "1.5.13",
"author": "Strencher",
"authorId": "415849376598982656",
"description": "Adds indicators for every platform that the user is using.",
Expand All @@ -11,9 +11,9 @@
"title": "Fixed",
"type": "fixed",
"items": [
"Plugin fixed for the latest Discord update"
"DM List and Member List work again"
]
}
],
"changelogDate": "2025-02-02"
"changelogDate": "2025-02-28"
}

0 comments on commit ba8d7d0

Please sign in to comment.