diff --git a/src/components/right/RightColumn.tsx b/src/components/right/RightColumn.tsx index c19461ca..f716a58b 100644 --- a/src/components/right/RightColumn.tsx +++ b/src/components/right/RightColumn.tsx @@ -276,7 +276,7 @@ const RightColumn: FC = ({ ); case RightColumnContent.Statistics: - return ; + return ; case RightColumnContent.MessageStatistics: return ; case RightColumnContent.StickerSearch: @@ -319,6 +319,7 @@ const RightColumn: FC = ({ renderCount={MAIN_SCREENS_COUNT + MANAGEMENT_SCREENS_COUNT} activeKey={isManagement ? MAIN_SCREENS_COUNT + managementScreen : renderingContentKey} shouldCleanup + cleanupExceptionKey={renderingContentKey === RightColumnContent.MessageStatistics ? RightColumnContent.Statistics : undefined} > {renderContent} diff --git a/src/components/right/statistics/Statistics.tsx b/src/components/right/statistics/Statistics.tsx index 868680cd..7839bf9b 100644 --- a/src/components/right/statistics/Statistics.tsx +++ b/src/components/right/statistics/Statistics.tsx @@ -61,23 +61,19 @@ const GROUP_GRAPHS = Object.keys(GROUP_GRAPHS_TITLES) as (keyof ApiGroupStatisti export type OwnProps = { chatId: string; - isActive: boolean; }; export type StateProps = { statistics: ApiChannelStatistics | ApiGroupStatistics; dcId?: number; isGroup: boolean; - messageId?: number; }; const Statistics: FC = ({ chatId, - isActive, statistics, dcId, isGroup, - messageId, }) => { const lang = useLang(); // eslint-disable-next-line no-null/no-null @@ -92,13 +88,6 @@ const Statistics: FC = ({ loadStatistics({ chatId, isGroup }); }, [chatId, loadStatistics, isGroup]); - useEffect(() => { - if (!isActive) { - loadedCharts.current = []; - setIsReady(false); - } - }, [isActive]); - const graphs = useMemo(() => { return isGroup ? GROUP_GRAPHS : CHANNEL_GRAPHS; }, [isGroup]); @@ -179,7 +168,7 @@ const Statistics: FC = ({ graphs, graphTitles, isReady, statistics, lang, chatId, loadStatisticsAsyncGraph, dcId, forceUpdate, ]); - if (!isReady || !statistics || messageId) { + if (!isReady || !statistics) { return ; } @@ -214,11 +203,9 @@ export default memo(withGlobal( const chat = selectChat(global, chatId); const dcId = chat?.fullInfo?.statisticsDcId; const isGroup = chat?.type === 'chatTypeSuperGroup'; - // Show Loading component if message was already selected for improving transition animation - const messageId = global.statistics.currentMessageId; return { - statistics, dcId, isGroup, messageId, + statistics, dcId, isGroup, }; }, )(Statistics));