diff --git a/src/components/left/LeftColumn.tsx b/src/components/left/LeftColumn.tsx index a998bdc5d..19cd8f934 100644 --- a/src/components/left/LeftColumn.tsx +++ b/src/components/left/LeftColumn.tsx @@ -243,6 +243,8 @@ const LeftColumn: FC = ({ name={IS_SINGLE_COLUMN_LAYOUT ? 'slide-layers' : 'push-slide'} renderCount={RENDER_COUNT} activeKey={contentType} + shouldCleanup + cleanupExceptionKey={ContentType.Main} > {(isActive) => { switch (contentType) { diff --git a/src/components/left/main/LeftMain.tsx b/src/components/left/main/LeftMain.tsx index 68af7bdda..f4dd2ca23 100644 --- a/src/components/left/main/LeftMain.tsx +++ b/src/components/left/main/LeftMain.tsx @@ -122,7 +122,13 @@ const LeftMain: FC = ({ onReset={onReset} /> - + {(isActive) => { switch (content) { case LeftColumnContent.ChatList: diff --git a/src/components/left/search/LeftSearch.tsx b/src/components/left/search/LeftSearch.tsx index c51719f66..15ccb8efb 100644 --- a/src/components/left/search/LeftSearch.tsx +++ b/src/components/left/search/LeftSearch.tsx @@ -63,7 +63,7 @@ const LeftSearch: FC = ({ onReset, }) => { const lang = useLang(); - const [activeTab, setActiveTab] = useState(0); + const [activeTab, setActiveTab] = useState(currentContent); const dateSearchQuery = useMemo(() => parseDateString(searchQuery), [searchQuery]); const handleSwitchTab = useCallback((index: number) => { diff --git a/src/components/right/RightColumn.tsx b/src/components/right/RightColumn.tsx index ec588169b..f64103635 100644 --- a/src/components/right/RightColumn.tsx +++ b/src/components/right/RightColumn.tsx @@ -253,6 +253,8 @@ const RightColumn: FC = ({ name={shouldSkipTransition ? 'none' : 'zoom-fade'} renderCount={MAIN_SCREENS_COUNT + MANAGEMENT_SCREENS_COUNT} activeKey={isManagement ? MAIN_SCREENS_COUNT + managementScreen : renderingContentKey} + shouldCleanup + cleanupExceptionKey={RightColumnContent.ChatInfo} > {renderContent} diff --git a/src/components/ui/Transition.tsx b/src/components/ui/Transition.tsx index 89e3bfadd..fa38f6862 100644 --- a/src/components/ui/Transition.tsx +++ b/src/components/ui/Transition.tsx @@ -25,6 +25,7 @@ type OwnProps = { renderCount?: number; shouldRestoreHeight?: boolean; shouldCleanup?: boolean; + cleanupExceptionKey?: number; id?: string; className?: string; onStart?: () => void; @@ -55,6 +56,7 @@ const Transition: FC = ({ renderCount, shouldRestoreHeight, shouldCleanup, + cleanupExceptionKey, id, className, onStart, @@ -85,7 +87,7 @@ const Transition: FC = ({ useLayoutEffect(() => { function cleanup() { - if (!shouldCleanup) { + if (!shouldCleanup || cleanupExceptionKey === prevActiveKey) { return; } @@ -212,6 +214,7 @@ const Transition: FC = ({ renderCount, shouldRestoreHeight, shouldCleanup, + cleanupExceptionKey, animationLevel, forceUpdate, ]); diff --git a/src/modules/actions/apiUpdaters/initial.ts b/src/modules/actions/apiUpdaters/initial.ts index 121d2c30b..c85fea5fc 100644 --- a/src/modules/actions/apiUpdaters/initial.ts +++ b/src/modules/actions/apiUpdaters/initial.ts @@ -19,7 +19,7 @@ import { setLanguage } from '../../../util/langProvider'; addReducer('apiUpdate', (global, actions, update: ApiUpdate) => { if (DEBUG) { - if (update['@type'] !== 'updateUserStatus') { + if (update['@type'] !== 'updateUserStatus' && update['@type'] !== 'updateServerTimeOffset') { // eslint-disable-next-line no-console console.log('[GramJs] UPDATE', update['@type'], { update }); }