Skip to content

Commit

Permalink
Merge pull request #28897 from DylanDylann/fix/27776
Browse files Browse the repository at this point in the history
Fix/27776 Workspace - WS invite page keeps loading in offline if no members present
  • Loading branch information
MariaHCD authored Oct 10, 2023
2 parents c228338 + eba4c5d commit c68bf6a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
15 changes: 10 additions & 5 deletions src/pages/workspace/WorkspaceMembersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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 (
<ScreenWrapper
Expand Down Expand Up @@ -411,11 +416,11 @@ function WorkspaceMembersPage(props) {
textInputLabel={props.translate('optionsSelector.findMember')}
textInputValue={searchValue}
onChangeText={setSearchValue}
headerMessage={headerMessage}
headerMessage={getHeaderMessage()}
onSelectRow={(item) => 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}
Expand Down

0 comments on commit c68bf6a

Please sign in to comment.