Skip to content

Commit

Permalink
fix: Fixed better screenshare/mic setting ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Loukious committed Dec 20, 2024
1 parent 7be5598 commit 47aeda2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/plugins/philsPluginLibrary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ export default new class Plugin implements PluginDef {
this.name = PluginInfo.PLUGIN_NAME;
this.description = PluginInfo.DESCRIPTION;
this.authors = PluginInfo.AUTHORS as PluginAuthor[];

this.replacedUserPanelComponent = replacedUserPanelComponent.bind(this);
this.patches = [{
find: "Messages.ACCOUNT_A11Y_LABEL",
find: "--custom-app-panels-height",
replacement: {
match: /(?<=function)( .{0,3}(?={).)(.{0,1000}custom-app-panels-height.+?\)]}\))(})/,
replace: "$1return $self.replacedUserPanelComponent(function(){$2}, this, arguments)$3"
match: /(\w+\.\w+\(\w+,{\w+:function\(\){)return (\w)+}/,
replace: "$1 $self.storedComp = $2; return $self.replacedUserPanelComponent}"
}
}];
this.replacedUserPanelComponent = replacedUserPanelComponent;
}
};

Expand Down
7 changes: 3 additions & 4 deletions src/plugins/philsPluginLibrary/patches/userPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,13 @@ export const ButtonsSettingsPanel = () => {
</>;
};

export function replacedUserPanelComponent(oldComponent: (...args: any[]) => any, thisContext: any, functionArguments: any) {
const componentResult: JSX.Element = Reflect.apply(oldComponent, thisContext, functionArguments);

export function replacedUserPanelComponent() {
// @ts-ignore
const componentResult: JSX.Element = this.storedComp();
if (!componentResult?.props) return componentResult;

const { children } = componentResult.props;


children.splice(children.length - 1, 0,
<ButtonsSettingsPanel />
);
Expand Down

0 comments on commit 47aeda2

Please sign in to comment.