Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#37605 Do not show "member not found" when loading member list #37731

Merged
Merged
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
9 changes: 7 additions & 2 deletions src/pages/workspace/WorkspaceMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ function WorkspaceMembersPage({policyMembers, personalDetails, route, policy, se
const {isSmallScreenWidth} = useWindowDimensions();
const dropdownButtonRef = useRef(null);
const isPolicyAdmin = PolicyUtils.isPolicyAdmin(policy);
const isLoading = useMemo(
() => !isOfflineAndNoMemberDataAvailable && (!OptionsListUtils.isPersonalDetailsReady(personalDetails) || isEmptyObject(policyMembers)),
[isOfflineAndNoMemberDataAvailable, personalDetails, policyMembers],
);

/**
* Get filtered personalDetails list with current policyMembers
Expand Down Expand Up @@ -372,7 +376,8 @@ function WorkspaceMembersPage({policyMembers, personalDetails, route, policy, se
if (isOfflineAndNoMemberDataAvailable) {
return translate('workspace.common.mustBeOnlineToViewMembers');
}
return !data.length ? translate('workspace.common.memberNotFound') : '';

return !isLoading && isEmptyObject(policyMembers) ? translate('workspace.common.memberNotFound') : '';
};

const getHeaderContent = () => (
Expand Down Expand Up @@ -542,7 +547,7 @@ function WorkspaceMembersPage({policyMembers, personalDetails, route, policy, se
onCheckboxPress={(item) => toggleUser(item.accountID)}
onSelectAll={() => toggleAllUsers(data)}
onDismissError={dismissError}
showLoadingPlaceholder={!isOfflineAndNoMemberDataAvailable && (!OptionsListUtils.isPersonalDetailsReady(personalDetails) || isEmptyObject(policyMembers))}
showLoadingPlaceholder={isLoading}
showScrollIndicator
shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()}
ref={textInputRef}
Expand Down
Loading