Skip to content

Commit

Permalink
fix(Translator): chatBarButton's module now exports multiple other va…
Browse files Browse the repository at this point in the history
…lues(?)
  • Loading branch information
yofukashino authored Dec 12, 2024
1 parent 89b772f commit 3625c50
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/Translator/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ export const renderTranslatedTag = (message: APIMessage): React.ReactNode =>
originalCache.has(message?.id) && <TranslatedTag />;

export const start = async (): Promise<void> => {
const chatBarButtons = await webpack.waitForModule<{
const channelBarButtonsMod = await webpack.waitForModule(
webpack.filters.bySource(/.{1,3}\.getSentUserIds\(\)/),
);

const chatBarButtons = webpack.getExportsForProps<{
type: (props: { type: { analyticsName?: string } }) => React.ReactElement;
}>(webpack.filters.bySource(/.{1,3}\.getSentUserIds\(\)/));
}>(channelBarButtonsMod, ['type']);

injector.after(chatBarButtons, 'type', ([args], res): React.ReactElement => {
const buttonElement = ['normal', 'sidebar'].includes(args?.type?.analyticsName) && (
Expand Down

0 comments on commit 3625c50

Please sign in to comment.