Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Prepare environment
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "20"

- run: npm install --global pnpm

Expand Down
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