Skip to content

Commit

Permalink
refactor(HideCallButtons): add comments for patches
Browse files Browse the repository at this point in the history
  • Loading branch information
janisslsm committed Nov 8, 2023
1 parent a608ed7 commit 7f0ffb2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/HideCallButtons/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export default {
const ChannelActions = findByName("ChannelActions", false);
const Header = findByName("Header", false);
const FocusedControlsBottomControls = findByName("FocusedControlsBottomControls", false);


// User Profile
patches.push(after("default", UserProfileActions, (_, component) => {
if(!storage.upHideVideoButton && !storage.upHideVoiceButton) return;
const buttons = findInReactTree(component, (x) => x?.props?.children[1]?.type?.name == "_default")?.props?.children;
Expand All @@ -40,7 +41,8 @@ export default {

return [component]
}));


// VC
patches.push(after("default", FocusedControlsBottomControls, (_, component) => {
if(!storage.hideVCVideoButton) return;
const children = component?.props?.children?.props?.children;
Expand All @@ -58,6 +60,7 @@ export default {
});
}));

// Tabs V2 DM Title bar
patches.push(after("default", ChannelActions, (_, component) => {
if(!storage.dmHideCallButton && !storage.dmHideVideoButton) return;

Expand All @@ -81,6 +84,7 @@ export default {
return [component];
}));

// Legacy UI DM Title Bar
patches.push(after("default", Header, (_, component) => {
if(!storage.dmHideCallButton && !storage.dmHideVideoButton) return;

Expand Down

0 comments on commit 7f0ffb2

Please sign in to comment.