File tree Expand file tree Collapse file tree
src/pages/workspace/downgrade Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React , { useMemo , useState } from 'react' ;
2+ import { InteractionManager } from 'react-native' ;
23import ConfirmModal from '@components/ConfirmModal' ;
34import HeaderWithBackButton from '@components/HeaderWithBackButton' ;
45import ScreenWrapper from '@components/ScreenWrapper' ;
@@ -54,13 +55,23 @@ function WorkspaceDowngradePage({route}: WorkspaceDowngradePageProps) {
5455 Navigation . dismissModal ( ) ;
5556 } ;
5657
58+ const dismissModalAndNavigate = ( targetPolicyID : string ) => {
59+ Navigation . dismissModal ( ) ;
60+ Navigation . isNavigationReady ( ) . then ( ( ) => {
61+ Navigation . navigate ( ROUTES . WORKSPACE_COMPANY_CARDS . getRoute ( targetPolicyID ) ) ;
62+ InteractionManager . runAfterInteractions ( ( ) => {
63+ Navigation . navigate ( ROUTES . WORKSPACE_COMPANY_CARDS_SELECT_FEED . getRoute ( targetPolicyID ) ) ;
64+ } ) ;
65+ } ) ;
66+ } ;
67+
5768 const onMoveToCompanyCardFeeds = ( ) => {
5869 if ( ! policyID ) {
5970 return ;
6071 }
72+
6173 setIsDowngradeWarningModalOpen ( false ) ;
62- Navigation . navigate ( ROUTES . WORKSPACE_COMPANY_CARDS . getRoute ( policyID ) ) ;
63- Navigation . navigate ( ROUTES . WORKSPACE_COMPANY_CARDS_SELECT_FEED . getRoute ( policyID ) ) ;
74+ InteractionManager . runAfterInteractions ( ( ) => dismissModalAndNavigate ( policyID ) ) ;
6475 } ;
6576
6677 if ( ! canPerformDowngrade ) {
You can’t perform that action at this time.
0 commit comments