Skip to content

Commit

Permalink
HideGiftButton: actually block by type
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico040 committed Jul 5, 2024
1 parent 850ab41 commit 708ee3f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/HideGiftButton/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ let unpatch: () => boolean;
export default {
onLoad() {
const blockList = ["ic_thread_normal_24px", "ic_gift"].map(n => getAssetIDByName(n));
const blockTypeList = [6];
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));
input.props.actions = input.props.actions.filter(a =>
!blockList.includes(a.source) && !blockTypeList.includes(a.type));
});
},
onUnload: unpatch
Expand Down

0 comments on commit 708ee3f

Please sign in to comment.