fix: hide collaborator list on mobile if empty ()

Co-authored-by: Lipis <lipiridis@gmail.com>
pull/2939/head
David Luzar committed by GitHub
parent b79ef0d428
commit 00209ef9c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -513,17 +513,18 @@ const LayerUI = ({
"transition-right": zenModeEnabled, "transition-right": zenModeEnabled,
})} })}
> >
{Array.from(appState.collaborators) {appState.collaborators.size > 0 &&
// Collaborator is either not initialized or is actually the current user. Array.from(appState.collaborators)
.filter(([_, client]) => Object.keys(client).length !== 0) // Collaborator is either not initialized or is actually the current user.
.map(([clientId, client]) => ( .filter(([_, client]) => Object.keys(client).length !== 0)
<Tooltip .map(([clientId, client]) => (
label={client.username || "Unknown user"} <Tooltip
key={clientId} label={client.username || "Unknown user"}
> key={clientId}
{actionManager.renderAction("goToCollaborator", clientId)} >
</Tooltip> {actionManager.renderAction("goToCollaborator", clientId)}
))} </Tooltip>
))}
</UserList> </UserList>
</div> </div>
</FixedSideContainer> </FixedSideContainer>

@ -152,24 +152,26 @@ export const MobileMenu = ({
<Stack.Col gap={4}> <Stack.Col gap={4}>
{renderCanvasActions()} {renderCanvasActions()}
{renderCustomFooter?.(true)} {renderCustomFooter?.(true)}
<fieldset> {appState.collaborators.size > 0 && (
<legend>{t("labels.collaborators")}</legend> <fieldset>
<UserList mobile> <legend>{t("labels.collaborators")}</legend>
{Array.from(appState.collaborators) <UserList mobile>
// Collaborator is either not initialized or is actually the current user. {Array.from(appState.collaborators)
.filter( // Collaborator is either not initialized or is actually the current user.
([_, client]) => Object.keys(client).length !== 0, .filter(
) ([_, client]) => Object.keys(client).length !== 0,
.map(([clientId, client]) => ( )
<React.Fragment key={clientId}> .map(([clientId, client]) => (
{actionManager.renderAction( <React.Fragment key={clientId}>
"goToCollaborator", {actionManager.renderAction(
clientId, "goToCollaborator",
)} clientId,
</React.Fragment> )}
))} </React.Fragment>
</UserList> ))}
</fieldset> </UserList>
</fieldset>
)}
</Stack.Col> </Stack.Col>
</div> </div>
</Section> </Section>

Loading…
Cancel
Save