Remove curly braces

This commit is contained in:
nico.benaz 2025-04-21 11:53:03 +02:00 committed by GitHub
parent cb3f0c7364
commit 72c4293bc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2235,152 +2235,151 @@ export const Group = ({
: '0px', : '0px',
}} }}
> >
{
<DesktopHeader
isPrivate={isPrivate}
selectedGroup={selectedGroup}
groupSection={groupSection}
isUnread={isUnread}
goToAnnouncements={goToAnnouncements}
isUnreadChat={isUnreadChat}
goToChat={goToChat}
goToThreads={goToThreads}
setOpenManageMembers={setOpenManageMembers}
groupChatHasUnread={groupChatHasUnread}
groupsAnnHasUnread={groupsAnnHasUnread}
directChatHasUnread={directChatHasUnread}
chatMode={chatMode}
openDrawerGroups={openDrawerGroups}
goToHome={goToHome}
setIsOpenDrawerProfile={setIsOpenDrawerProfile}
mobileViewMode={mobileViewMode}
setMobileViewMode={setMobileViewMode}
setMobileViewModeKeepOpen={setMobileViewModeKeepOpen}
hasUnreadGroups={groupChatHasUnread || groupsAnnHasUnread}
hasUnreadDirects={directChatHasUnread}
myName={userInfo?.name || null}
isHome={groupSection === 'home'}
isGroups={desktopSideView === 'groups'}
isDirects={desktopSideView === 'directs'}
setDesktopSideView={setDesktopSideView}
hasUnreadAnnouncements={isUnread}
isAnnouncement={groupSection === 'announcement'}
isChat={groupSection === 'chat'}
hasUnreadChat={isUnreadChat}
setGroupSection={setGroupSection}
isForum={groupSection === 'forum'}
/>
}
<Box <DesktopHeader
sx={{ isPrivate={isPrivate}
display: 'flex', selectedGroup={selectedGroup}
flexGrow: 1, groupSection={groupSection}
height: 'calc(100vh - 70px)', isUnread={isUnread}
position: 'relative', goToAnnouncements={goToAnnouncements}
}} isUnreadChat={isUnreadChat}
> goToChat={goToChat}
{triedToFetchSecretKey && ( goToThreads={goToThreads}
<ChatGroup setOpenManageMembers={setOpenManageMembers}
myAddress={myAddress} groupChatHasUnread={groupChatHasUnread}
selectedGroup={selectedGroup?.groupId} groupsAnnHasUnread={groupsAnnHasUnread}
getSecretKey={getSecretKey} directChatHasUnread={directChatHasUnread}
secretKey={secretKey} chatMode={chatMode}
isPrivate={isPrivate} openDrawerGroups={openDrawerGroups}
setSecretKey={setSecretKey} goToHome={goToHome}
handleNewEncryptionNotification={setNewEncryptionNotification} setIsOpenDrawerProfile={setIsOpenDrawerProfile}
hide={groupSection !== 'chat' || selectedDirect || newChat} mobileViewMode={mobileViewMode}
hideView={!(desktopViewMode === 'chat' && selectedGroup)} setMobileViewMode={setMobileViewMode}
handleSecretKeyCreationInProgress={ setMobileViewModeKeepOpen={setMobileViewModeKeepOpen}
handleSecretKeyCreationInProgress hasUnreadGroups={groupChatHasUnread || groupsAnnHasUnread}
} hasUnreadDirects={directChatHasUnread}
triedToFetchSecretKey={triedToFetchSecretKey} myName={userInfo?.name || null}
myName={userInfo?.name} isHome={groupSection === 'home'}
balance={balance} isGroups={desktopSideView === 'groups'}
getTimestampEnterChatParent={getTimestampEnterChat} isDirects={desktopSideView === 'directs'}
/> setDesktopSideView={setDesktopSideView}
hasUnreadAnnouncements={isUnread}
isAnnouncement={groupSection === 'announcement'}
isChat={groupSection === 'chat'}
hasUnreadChat={isUnreadChat}
setGroupSection={setGroupSection}
isForum={groupSection === 'forum'}
/>
<Box
sx={{
display: 'flex',
flexGrow: 1,
height: 'calc(100vh - 70px)',
position: 'relative',
}}
>
{triedToFetchSecretKey && (
<ChatGroup
myAddress={myAddress}
selectedGroup={selectedGroup?.groupId}
getSecretKey={getSecretKey}
secretKey={secretKey}
isPrivate={isPrivate}
setSecretKey={setSecretKey}
handleNewEncryptionNotification={setNewEncryptionNotification}
hide={groupSection !== 'chat' || selectedDirect || newChat}
hideView={!(desktopViewMode === 'chat' && selectedGroup)}
handleSecretKeyCreationInProgress={
handleSecretKeyCreationInProgress
}
triedToFetchSecretKey={triedToFetchSecretKey}
myName={userInfo?.name}
balance={balance}
getTimestampEnterChatParent={getTimestampEnterChat}
/>
)}
{isPrivate &&
firstSecretKeyInCreation &&
triedToFetchSecretKey &&
!secretKeyPublishDate && (
<div
style={{
alignItems: 'flex-start',
display: 'flex',
flexDirection: 'column',
height: '100%',
padding: '20px',
width: '100%',
}}
>
{' '}
<Typography>
The group's first common encryption key is in the process
of creation. Please wait a few minutes for it to be
retrieved by the network. Checking every 2 minutes...
</Typography>
</div>
)} )}
{isPrivate && {isPrivate &&
firstSecretKeyInCreation && !admins.includes(myAddress) &&
triedToFetchSecretKey && !secretKey &&
!secretKeyPublishDate && ( triedToFetchSecretKey ? (
<>
{secretKeyPublishDate ||
(!secretKeyPublishDate && !firstSecretKeyInCreation) ? (
<div <div
style={{ style={{
alignItems: 'flex-start', alignItems: 'flex-start',
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
height: '100%', height: 'calc(100vh - 70px)',
overflow: 'auto',
padding: '20px', padding: '20px',
width: '100%', width: '100%',
}} }}
> >
{' '} {' '}
<Typography> <Typography>
The group's first common encryption key is in the process You are not part of the encrypted group of members. Wait
of creation. Please wait a few minutes for it to be until an admin re-encrypts the keys.
retrieved by the network. Checking every 2 minutes...
</Typography> </Typography>
</div> <Spacer height="25px" />
)} <Typography>
{isPrivate && <strong>
!admins.includes(myAddress) && Only unencrypted messages will be displayed.
!secretKey && </strong>
triedToFetchSecretKey ? ( </Typography>
<> <Spacer height="25px" />
{secretKeyPublishDate || <Typography>
(!secretKeyPublishDate && !firstSecretKeyInCreation) ? ( Try notifying an admin from the list of admins below:
<div </Typography>
style={{ <Spacer height="25px" />
alignItems: 'flex-start', {adminsWithNames.map((admin) => {
display: 'flex', return (
flexDirection: 'column', <Box
height: 'calc(100vh - 70px)', sx={{
overflow: 'auto', display: 'flex',
padding: '20px', gap: '20px',
width: '100%', padding: '15px',
}} alignItems: 'center',
> }}
{' '} >
<Typography> <Typography>{admin?.name}</Typography>
You are not part of the encrypted group of members. Wait <LoadingButton
until an admin re-encrypts the keys. loading={isLoadingNotifyAdmin}
</Typography> loadingPosition="start"
<Spacer height="25px" /> variant="contained"
<Typography> onClick={() => notifyAdmin(admin)}
<strong>
Only unencrypted messages will be displayed.
</strong>
</Typography>
<Spacer height="25px" />
<Typography>
Try notifying an admin from the list of admins below:
</Typography>
<Spacer height="25px" />
{adminsWithNames.map((admin) => {
return (
<Box
sx={{
display: 'flex',
gap: '20px',
padding: '15px',
alignItems: 'center',
}}
> >
<Typography>{admin?.name}</Typography> Notify
<LoadingButton </LoadingButton>
loading={isLoadingNotifyAdmin} </Box>
loadingPosition="start" );
variant="contained" })}
onClick={() => notifyAdmin(admin)} </div>
> ) : null}
Notify </>
</LoadingButton>
</Box>
);
})}
</div>
) : null}
</>
) : admins.includes(myAddress) && ) : admins.includes(myAddress) &&
!secretKey && !secretKey &&
isPrivate && isPrivate &&
@ -2521,64 +2520,59 @@ export const Group = ({
</> </>
)} )}
{ <AppsDesktop
<AppsDesktop toggleSideViewGroups={toggleSideViewGroups}
toggleSideViewGroups={toggleSideViewGroups} toggleSideViewDirects={toggleSideViewDirects}
toggleSideViewDirects={toggleSideViewDirects} goToHome={goToHome}
goToHome={goToHome} mode={appsMode}
mode={appsMode} setMode={setAppsMode}
setMode={setAppsMode} setDesktopSideView={setDesktopSideView}
setDesktopSideView={setDesktopSideView} hasUnreadDirects={directChatHasUnread}
hasUnreadDirects={directChatHasUnread} show={desktopViewMode === 'apps'}
show={desktopViewMode === 'apps'} myName={userInfo?.name}
myName={userInfo?.name} isGroups={isOpenSideViewGroups}
isGroups={isOpenSideViewGroups} isDirects={isOpenSideViewDirects}
isDirects={isOpenSideViewDirects} hasUnreadGroups={groupChatHasUnread || groupsAnnHasUnread}
hasUnreadGroups={groupChatHasUnread || groupsAnnHasUnread} setDesktopViewMode={setDesktopViewMode}
setDesktopViewMode={setDesktopViewMode} isApps={desktopViewMode === 'apps'}
isApps={desktopViewMode === 'apps'} desktopViewMode={desktopViewMode}
desktopViewMode={desktopViewMode} />
/>
}
{
<AppsDevMode
toggleSideViewGroups={toggleSideViewGroups}
toggleSideViewDirects={toggleSideViewDirects}
goToHome={goToHome}
mode={appsModeDev}
setMode={setAppsModeDev}
setDesktopSideView={setDesktopSideView}
hasUnreadDirects={directChatHasUnread}
show={desktopViewMode === 'dev'}
myName={userInfo?.name}
isGroups={isOpenSideViewGroups}
isDirects={isOpenSideViewDirects}
hasUnreadGroups={groupChatHasUnread || groupsAnnHasUnread}
setDesktopViewMode={setDesktopViewMode}
desktopViewMode={desktopViewMode}
isApps={desktopViewMode === 'apps'}
/>
}
{ <AppsDevMode
<HomeDesktop toggleSideViewGroups={toggleSideViewGroups}
name={userInfo?.name} toggleSideViewDirects={toggleSideViewDirects}
refreshHomeDataFunc={refreshHomeDataFunc} goToHome={goToHome}
myAddress={myAddress} mode={appsModeDev}
isLoadingGroups={isLoadingGroups} setMode={setAppsModeDev}
balance={balance} setDesktopSideView={setDesktopSideView}
userInfo={userInfo} hasUnreadDirects={directChatHasUnread}
groups={groups} show={desktopViewMode === 'dev'}
setGroupSection={setGroupSection} myName={userInfo?.name}
setSelectedGroup={setSelectedGroup} isGroups={isOpenSideViewGroups}
getTimestampEnterChat={getTimestampEnterChat} isDirects={isOpenSideViewDirects}
setOpenManageMembers={setOpenManageMembers} hasUnreadGroups={groupChatHasUnread || groupsAnnHasUnread}
setOpenAddGroup={setOpenAddGroup} setDesktopViewMode={setDesktopViewMode}
setMobileViewMode={setMobileViewMode} desktopViewMode={desktopViewMode}
setDesktopViewMode={setDesktopViewMode} isApps={desktopViewMode === 'apps'}
desktopViewMode={desktopViewMode} />
/>
} <HomeDesktop
name={userInfo?.name}
refreshHomeDataFunc={refreshHomeDataFunc}
myAddress={myAddress}
isLoadingGroups={isLoadingGroups}
balance={balance}
userInfo={userInfo}
groups={groups}
setGroupSection={setGroupSection}
setSelectedGroup={setSelectedGroup}
getTimestampEnterChat={getTimestampEnterChat}
setOpenManageMembers={setOpenManageMembers}
setOpenAddGroup={setOpenAddGroup}
setMobileViewMode={setMobileViewMode}
setDesktopViewMode={setDesktopViewMode}
desktopViewMode={desktopViewMode}
/>
</Box> </Box>
<AuthenticatedContainerInnerRight <AuthenticatedContainerInnerRight