diff --git a/plugins/HideGiftButton/src/index.ts b/plugins/HideGiftButton/src/index.ts index ee57d8e..8596e8f 100644 --- a/plugins/HideGiftButton/src/index.ts +++ b/plugins/HideGiftButton/src/index.ts @@ -1,5 +1,6 @@ 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"); @@ -8,10 +9,13 @@ let unpatch: () => boolean; export default { onLoad() { - // 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]; + // 269 - static ic_gift asset id for >236 + const blockList = ["ic_thread_normal_24px", "ic_gift", 269].map(n => { + if (typeof n === "string") { + return getAssetIDByName(n); + } + return n; + }); 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));