Skip to content

Commit 708ee3f

Browse files
committed
HideGiftButton: actually block by type
1 parent 850ab41 commit 708ee3f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

plugins/HideGiftButton/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ let unpatch: () => boolean;
1010
export default {
1111
onLoad() {
1212
const blockList = ["ic_thread_normal_24px", "ic_gift"].map(n => getAssetIDByName(n));
13+
const blockTypeList = [6];
1314
unpatch = after("render", ChatInput.prototype, (_, ret) => {
1415
const input = findInReactTree(ret, t => "forceAnimateButtons" in t.props && t.props.actions);
15-
input.props.actions = input.props.actions.filter(a => !blockList.includes(a.source));
16+
input.props.actions = input.props.actions.filter(a =>
17+
!blockList.includes(a.source) && !blockTypeList.includes(a.type));
1618
});
1719
},
1820
onUnload: unpatch

0 commit comments

Comments
 (0)