fix: keep the "no pending message requests" opened when none are there

pull/2620/head
Audric Ackermann 2 years ago
parent 87e4458645
commit 5d4bce3e04

@ -1,4 +1,4 @@
import React, { useEffect } from 'react';
import React from 'react';
// tslint:disable: no-submodule-imports use-simple-attributes
import { useDispatch, useSelector } from 'react-redux';
@ -6,9 +6,8 @@ import useKey from 'react-use/lib/useKey';
import styled from 'styled-components';
import { declineConversationWithoutConfirm } from '../../../interactions/conversationInteractions';
import { forceSyncConfigurationNowIfNeeded } from '../../../session/utils/sync/syncUtils';
import { resetConversationExternal } from '../../../state/ducks/conversations';
import { updateConfirmModal } from '../../../state/ducks/modalDialog';
import { SectionType, resetOverlayMode, showLeftPaneSection } from '../../../state/ducks/section';
import { resetOverlayMode } from '../../../state/ducks/section';
import { getConversationRequests } from '../../../state/selectors/conversations';
import { useSelectedConversationKey } from '../../../state/selectors/selectedConversation';
import { SessionButton, SessionButtonColor } from '../../basic/SessionButton';
@ -52,16 +51,6 @@ export const OverlayMessageRequest = () => {
const convoRequestCount = useSelector(getConversationRequests).length;
const messageRequests = useSelector(getConversationRequests);
useEffect(() => {
// if no more requests, return to placeholder screen
if (convoRequestCount === 0) {
dispatch(resetOverlayMode());
dispatch(showLeftPaneSection(SectionType.Message));
dispatch(resetConversationExternal());
}
}, [dispatch, convoRequestCount]);
const buttonText = window.i18n('clearAll');
/**

@ -497,7 +497,10 @@ async function buildNewOnionPathsWorker() {
for (let i = 0; i < maxPath; i += 1) {
const path = [guards[i]];
for (let j = 0; j < nodesNeededPerPaths; j += 1) {
const randomWinner = _.sample(otherNodes) as Snode;
const randomWinner = _.sample(otherNodes);
if (!randomWinner) {
throw new Error('randomWinner unset during path building task');
}
otherNodes = otherNodes.filter(n => {
return n.pubkey_ed25519 !== randomWinner?.pubkey_ed25519;
});

Loading…
Cancel
Save