Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {View} from 'react-native';
import {InteractionManager, View} from 'react-native';
import type {GestureResponderEvent} from 'react-native/Libraries/Types/CoreEventTypes';
import type {ValueOf} from 'type-fest';
import Button from '@components/Button';
Expand Down Expand Up @@ -31,6 +31,7 @@ import WorkspaceMemberDetailsRoleSelectionModal from '@pages/workspace/Workspace
import type {ListItemType} from '@pages/workspace/WorkspaceMemberRoleSelectionModal';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';

type ImportedMembersConfirmationPageProps = PlatformStackScreenProps<SettingsNavigatorParamList, typeof SCREENS.WORKSPACE.MEMBERS_IMPORTED>;
Expand Down Expand Up @@ -205,6 +206,10 @@ function ImportedMembersConfirmationPage({route}: ImportedMembersConfirmationPag
isVisible={spreadsheet?.shouldFinalModalBeOpened}
closeImportPageAndModal={closeImportPageAndModal}
shouldHandleNavigationBack={false}
onModalHide={() => {
// eslint-disable-next-line @typescript-eslint/no-deprecated
InteractionManager.runAfterInteractions(() => Navigation.goBack(ROUTES.WORKSPACE_MEMBERS.getRoute(policyID)));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think we are in the process of removing runAfterInteractions from the codebase, so ideally we should not be adding more.

@war-in any thoughts?

@war-in war-in Nov 26, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could go with a similar approach to the one I created for RHP - #75381

But that probably would require ConfirmModal refactor

@nkdengineer nkdengineer Nov 26, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rlinoz The import modal is just refactored and it's missed the navigation logic here. I only copied the logic on the ImportedMemberPage to fix this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So once we get to remove from ImportedMembersPage we would end up refactoring the ConfirmModal and would fix this occurence as well?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @war-in @nkdengineer on the above question above.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think so. If @nkdengineer is not adding the new InteractionManager usage, we should not remove the already existing one

}}
/>
<WorkspaceMemberDetailsRoleSelectionModal
isVisible={isRoleSelectionModalVisible}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/workspace/members/ImportedMembersPage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {useIsFocused} from '@react-navigation/native';
import React, {useCallback, useState} from 'react';
import {InteractionManager} from 'react-native';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
Expand Down Expand Up @@ -33,6 +34,7 @@ function ImportedMembersPage({route}: ImportedMembersPageProps) {
const [shouldShowConfirmModal, setShouldShowConfirmModal] = useState(true);
const policyID = route.params.policyID;
const policy = usePolicy(policyID);
const isFocused = useIsFocused();

const columnNames = generateColumnNames(spreadsheet?.data?.length ?? 0);
const {containsHeader = true} = spreadsheet ?? {};
Expand Down Expand Up @@ -201,7 +203,7 @@ function ImportedMembersPage({route}: ImportedMembersPageProps) {
learnMoreLink={CONST.IMPORT_SPREADSHEET.MEMBERS_ARTICLE_LINK}
/>
<ImportSpreadsheetConfirmModal
isVisible={spreadsheet?.shouldFinalModalBeOpened && shouldShowConfirmModal}
isVisible={spreadsheet?.shouldFinalModalBeOpened && shouldShowConfirmModal && isFocused}
closeImportPageAndModal={closeImportPageAndModal}
onModalHide={() => {
// eslint-disable-next-line @typescript-eslint/no-deprecated
Expand Down
Loading