From 13800ddf018b68f322609db134a1b44a5639325a Mon Sep 17 00:00:00 2001 From: Ally Founder Date: Sun, 9 Aug 2026 01:52:54 -0400 Subject: [PATCH] staff-tags: fix existingTag lookup in member list, bump to 1.0.10 1.0.9 fixed the pairing bug and correctly located ret.props.label, but still used findInReactFiber to search within it for the existing BotTag element - confirmed live that findInReactFiber never matches here. It's built for real React fiber nodes, not the plain element tree innerRender() returns pre-reconciliation, so it silently found nothing and every row bailed out before ever calling getTag(). Since label.props.children is already a known flat array, a direct .find() locates the same BotTag element findInReactFiber was missing. Live end-to-end verified: OWNER tag now renders correctly in the member list for the actual guild owner. --- plugins/staff-tags/js/patches/details.tsx | 18 ++++++++++++------ plugins/staff-tags/manifest.json | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/plugins/staff-tags/js/patches/details.tsx b/plugins/staff-tags/js/patches/details.tsx index def479f..ad7c6e0 100644 --- a/plugins/staff-tags/js/patches/details.tsx +++ b/plugins/staff-tags/js/patches/details.tsx @@ -1,8 +1,6 @@ import { Stores } from '@revenge-mod/discord/flux' import { getModules } from '@revenge-mod/modules/finders' import { afterJSX } from '@revenge-mod/react/jsx-runtime' -import { findInReactFiber } from '@revenge-mod/utils/react' -import { fiberFilter } from '../lib/fiber' import { withMemoDefaultName } from '../lib/filters' import getTag from '../lib/getTag' import { guard } from '../lib/safe' @@ -107,10 +105,18 @@ export default function patchDetails(storage: JsonStorage) { | undefined if (!label || !Array.isArray(label.props?.children)) return ret - const existingTag = findInReactFiber( - label as any, - fiberFilter(c => c?.type?.Types), - ) + // A plain array `.find()`, not `findInReactFiber` - confirmed live that + // `findInReactFiber` doesn't match here. It's built for real React fiber + // nodes (`.child`/`.sibling`/`.return`), not the plain element tree `ret` + // actually is at this point (`innerRender`'s return value, pre-reconciliation + // - createElement() output, not yet a fiber). `label.props.children` is a + // flat, already-known array, so a direct search needs no fiber-walking helper. + const existingTag = ( + label.props.children as { + type?: { Types?: unknown } + props?: any + }[] + ).find(c => c?.type?.Types) if (existingTag && existingTag.props?.type !== 0) return ret const guild = GuildStore?.getGuild(guildId) diff --git a/plugins/staff-tags/manifest.json b/plugins/staff-tags/manifest.json index 9376856..0822320 100644 --- a/plugins/staff-tags/manifest.json +++ b/plugins/staff-tags/manifest.json @@ -4,7 +4,7 @@ "name": "Staff Tags", "description": "Adds customizable tags (OWNER, ADMIN, STAFF, MOD, and more) next to members based on their server permissions. Supports per-tag colors, gradients, custom text, and visibility toggles.", "author": "Rosie", - "version": "1.0.9", + "version": "1.0.10", "dependencies": { "revenge.api": { "version": ">=1 <2"