diff --git a/src/languages/en.ts b/src/languages/en.ts index 31a73410ead1..b4d83ac36217 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1362,6 +1362,7 @@ export default { notAuthorized: `You do not have access to this page. Are you trying to join the workspace? Please reach out to the owner of this workspace so they can add you as a member! Something else? Reach out to ${CONST.EMAIL.CONCIERGE}`, goToRoom: ({roomName}: GoToRoomParams) => `Go to ${roomName} room`, workspaceAvatar: 'Workspace avatar', + mustBeOnlineToViewMembers: 'You must be online in order to view members of this workspace.', }, emptyWorkspace: { title: 'Create a new workspace', diff --git a/src/languages/es.ts b/src/languages/es.ts index 939576ed791f..0e87425f3dde 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1382,6 +1382,7 @@ export default { notAuthorized: `No tienes acceso a esta página. ¿Estás tratando de unirte al espacio de trabajo? Comunícate con el propietario de este espacio de trabajo para que pueda añadirte como miembro. ¿Necesitas algo más? Comunícate con ${CONST.EMAIL.CONCIERGE}`, goToRoom: ({roomName}: GoToRoomParams) => `Ir a la sala ${roomName}`, workspaceAvatar: 'Espacio de trabajo avatar', + mustBeOnlineToViewMembers: 'Debes estar en línea para poder ver los miembros de este espacio de trabajo.', }, emptyWorkspace: { title: 'Crear un nuevo espacio de trabajo', diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 2e896f61afda..873ce8a03623 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -79,7 +79,7 @@ function WorkspaceMembersPage(props) { const accountIDs = useMemo(() => _.keys(props.policyMembers), [props.policyMembers]); const prevAccountIDs = usePrevious(accountIDs); const textInputRef = useRef(null); - + const isOfflineAndNoMemberDataAvailable = _.isEmpty(props.policyMembers) && props.network.isOffline; /** * Get members for the current workspace */ @@ -344,9 +344,14 @@ function WorkspaceMembersPage(props) { return result; }; - const data = getMemberOptions(); - const headerMessage = searchValue.trim() && !data.length ? props.translate('workspace.common.memberNotFound') : ''; + + const getHeaderMessage = () => { + if (isOfflineAndNoMemberDataAvailable) { + return props.translate('workspace.common.mustBeOnlineToViewMembers'); + } + return searchValue.trim() && !data.length ? props.translate('workspace.common.memberNotFound') : ''; + }; return ( toggleUser(item.keyForList)} onSelectAll={() => toggleAllUsers(data)} onDismissError={dismissError} - showLoadingPlaceholder={!OptionsListUtils.isPersonalDetailsReady(props.personalDetails) || _.isEmpty(props.policyMembers)} + showLoadingPlaceholder={!isOfflineAndNoMemberDataAvailable && (!OptionsListUtils.isPersonalDetailsReady(props.personalDetails) || _.isEmpty(props.policyMembers))} showScrollIndicator shouldFocusOnSelectRow={!Browser.isMobile()} inputRef={textInputRef}