Skip to content

Commit

Permalink
fix(HideCallButtons): buttons being removed from channels
Browse files Browse the repository at this point in the history
  • Loading branch information
janisslsm committed Oct 28, 2023
1 parent 80c6932 commit d71c2ce
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plugins/HideCallButtons/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export default {
storage.hideVCVideoButton ??= false;

const videoCallAsset = getAssetIDByName("ic_video");
const videoAsset = getAssetIDByName("video");
const callAsset = getAssetIDByName("nav_header_connect");

const UserProfileActions = findByName("UserProfileActions", false);
const ChannelActions = findByName("ChannelActions", false);
Expand All @@ -37,7 +39,8 @@ export default {
if(children === undefined) return;

var _default = component?.props?.children?.props?.children[1];

if(_default?.type?.name !== "_default") return;

const p1 = after("type", _default, (_, comp) => {
var buttons = comp?.props?.children?.props?.children?.props?.children;
if(buttons !== undefined)
Expand Down Expand Up @@ -80,8 +83,11 @@ export default {
const buttons = comp?.props?.buttons;
if(buttons !== undefined)
{
delete buttons[0];
delete buttons[1];
if(buttons[0].source === callAsset || buttons[0].source === videoAsset)
{
delete buttons[0];
delete buttons[1];
}
}
p3();
});
Expand Down

0 comments on commit d71c2ce

Please sign in to comment.