From e923879c521f50b82b43fda9968c3c6ea29421f1 Mon Sep 17 00:00:00 2001 From: M-ZubairAhmed Date: Wed, 15 Jan 2025 06:57:46 +0530 Subject: [PATCH] [MM-62568] Clicking on the channel header popover content throw js error (#29857) --- .../channel_header/channel_header_text_popover.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/webapp/channels/src/components/channel_header/channel_header_text_popover.tsx b/webapp/channels/src/components/channel_header/channel_header_text_popover.tsx index be15f3c2c9..ec8a1411f1 100644 --- a/webapp/channels/src/components/channel_header/channel_header_text_popover.tsx +++ b/webapp/channels/src/components/channel_header/channel_header_text_popover.tsx @@ -19,7 +19,7 @@ import { } from '@floating-ui/react'; import React, {useMemo, useRef, useState} from 'react'; import type {MouseEvent} from 'react'; -import {useDispatch, useSelector} from 'react-redux'; +import {useSelector} from 'react-redux'; import {getCurrentRelativeTeamUrl} from 'mattermost-redux/selectors/entities/teams'; @@ -56,8 +56,6 @@ interface Props { channelMentionsNameMap?: ChannelNamesMap; } export function ChannelHeaderTextPopover(props: Props) { - const dispatch = useDispatch(); - const currentRelativeTeamUrl = useSelector(getCurrentRelativeTeamUrl); const rootElementRef = useRef(null); @@ -118,7 +116,7 @@ export function ChannelHeaderTextPopover(props: Props) { // This action processes clicks on formatted text elements like hashtags, user mentions, // channel mentions, etc. while also allowing other elements to function as is such as external links etc function handleClick(event: MouseEvent) { - dispatch(handleFormattedTextClick(event, currentRelativeTeamUrl)); + handleFormattedTextClick(event, currentRelativeTeamUrl); } return (