Skip to content
Merged
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
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
Loading