Skip to content

Commit

Permalink
HideGiftButton: include static asset id
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico040 committed Jul 5, 2024
1 parent 850ab41 commit 84a11b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/HideGiftButton/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ let unpatch: () => boolean;

export default {
onLoad() {
const blockList = ["ic_thread_normal_24px", "ic_gift"].map(n => getAssetIDByName(n));
// 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));
Expand Down

0 comments on commit 84a11b4

Please sign in to comment.