diff --git a/package.json b/package.json index 7a4f72254..98441bd91 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "transpile": "tsc --incremental", "transpile:watch": "tsc -w", "integration-test": "mocha --recursive --exit --timeout 30000 \"./ts/test-integration/**/*.test.js\" \"./ts/test/*.test.js\"", - "clean-transpile": "rimraf 'ts/**/*.js ts/*.js' 'ts/*.js.map' 'ts/**/*.js.map' && rimraf tsconfig.tsbuildinfo;", + "clean-transpile": "rimraf 'ts/**/*.js' 'ts/*.js' 'ts/*.js.map' 'ts/**/*.js.map' && rimraf tsconfig.tsbuildinfo;", "ready": "yarn clean-transpile; yarn grunt && yarn lint-full && yarn test", "build:webpack:sql-worker": "cross-env NODE_ENV=production webpack -c webpack-sql-worker.config.ts", "sedtoAppImage": "sed -i 's/\"target\": \\[\"deb\", \"rpm\", \"freebsd\"\\]/\"target\": \"AppImage\"/g' package.json", diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index cda5a79b5..badeba855 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -888,6 +888,10 @@ flex-direction: column; align-items: stretch; overflow: hidden; + + .session-icon-button:first-child { + margin-right: $session-margin-sm; + } } .module-conversation-list-item__header { diff --git a/ts/components/ConversationListItem.tsx b/ts/components/ConversationListItem.tsx index 463a90a88..5131c8b49 100644 --- a/ts/components/ConversationListItem.tsx +++ b/ts/components/ConversationListItem.tsx @@ -22,13 +22,12 @@ import { } from '../state/ducks/conversations'; import _ from 'underscore'; import { useMembersAvatars } from '../hooks/useMembersAvatar'; -import { SessionIcon } from './session/icon'; +import { SessionIcon, SessionIconButton } from './session/icon'; import { useDispatch, useSelector } from 'react-redux'; import { SectionType } from '../state/ducks/section'; import { getFocusedSection } from '../state/selectors/section'; import { ConversationNotificationSettingType } from '../models/conversation'; import { Flex } from './basic/Flex'; -import { SessionButton, SessionButtonColor } from './session/SessionButton'; import { forceSyncConfigurationNowIfNeeded } from '../session/utils/syncUtils'; import { updateUserDetailsModal } from '../state/ducks/modalDialog'; import { approveConversation, blockConvoById } from '../interactions/conversationInteractions'; @@ -364,17 +363,25 @@ const ConversationListItem = (props: Props) => { flexDirection="row" justifyContent="flex-end" > - - { await approveConversation(conversationId); }} - text={window.i18n('accept')} + backgroundColor="var(--color-accent)" + iconColor="var(--color-foreground-primary)" + iconPadding="var(--margins-xs)" + borderRadius="2px" /> ) : null} diff --git a/ts/components/session/LeftPaneMessageSection.tsx b/ts/components/session/LeftPaneMessageSection.tsx index 6c3746d4b..79d7874b3 100644 --- a/ts/components/session/LeftPaneMessageSection.tsx +++ b/ts/components/session/LeftPaneMessageSection.tsx @@ -240,27 +240,9 @@ export class LeftPaneMessageSection extends React.Component { return; } - const conversationRequests = conversations.filter(conversation => { - // Add Open Group to list as soon as the name has been set - if ( - conversation.isPublic() && - (!conversation.get('name') || conversation.get('name') === 'Unknown group') - ) { - return false; - } - - // Remove all invalid conversations and conversatons of devices associated - // with cancelled attempted links - if (!conversation.isPublic && !conversation.get('active_at')) { - return false; - } - - if (conversation.attributes.isApproved || !conversation.get('active_at')) { - return false; - } - - return true; - }); + const conversationRequests = conversations.filter( + c => c.isPrivate() && c.get('active_at') && c.get('isApproved') + ); let syncRequired = false; diff --git a/ts/state/selectors/conversations.ts b/ts/state/selectors/conversations.ts index 07927f2fd..9b0364900 100644 --- a/ts/state/selectors/conversations.ts +++ b/ts/state/selectors/conversations.ts @@ -432,7 +432,7 @@ export const _getConversationRequests = ( isMessageRequestEnabled?: boolean ): Array => { const pushToMessageRequests = - isMessageRequestEnabled && window.lokiFeatureFlags?.useMessageRequests; + isMessageRequestEnabled && window?.lokiFeatureFlags?.useMessageRequests; return _.filter(sortedConversations, conversation => { return pushToMessageRequests && !conversation.isApproved && !conversation.isBlocked; });