From 22ef5eb5a2f891fb943df7a3b123660b1ccaeb70 Mon Sep 17 00:00:00 2001 From: Rico040 <93081680+Rico040@users.noreply.github.com> Date: Fri, 5 Jul 2024 21:07:03 +0900 Subject: [PATCH] ditch state spoofing and use actaul id instead of asset name --- plugins/HideGiftButton/src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/HideGiftButton/src/index.ts b/plugins/HideGiftButton/src/index.ts index 8bccb13..ee57d8e 100644 --- a/plugins/HideGiftButton/src/index.ts +++ b/plugins/HideGiftButton/src/index.ts @@ -1,6 +1,5 @@ import { findByName } from "@vendetta/metro"; import { after } from "@vendetta/patcher"; -import { getAssetIDByName } from "@vendetta/ui/assets"; import { findInReactTree } from "@vendetta/utils"; const ChatInput = findByName("ChatInput"); @@ -9,15 +8,16 @@ let unpatch: () => boolean; export default { onLoad() { - ChatInput.defaultProps.hideGiftButton = true; - const blockList = ["ic_thread_normal_24px", "ic_gift"].map(n => getAssetIDByName(n)); + // 332 - ic_thread_normal_24px + // 269 - ic_gift + // getAssetIDByName gives 369 which is also ic_gift but not that used in ChatInput + const blockList = [332, 269]; unpatch = after("render", ChatInput.prototype, (_, ret) => { const input = findInReactTree(ret, t => "forceAnimateButtons" in t.props && t.props.actions); input.props.actions = input.props.actions.filter(a => !blockList.includes(a.source)); }); }, onUnload() { - ChatInput.defaultProps.hideGiftButton = false; unpatch(); } };