From 563043bde17a4fd0f86420fb672580141ac25a76 Mon Sep 17 00:00:00 2001 From: Kacper Michalik Date: Mon, 6 Nov 2023 13:31:56 +0100 Subject: [PATCH 1/6] feat: hide button --- CHANGELOG.md | 4 ++ ...ibleImpersonationAttackModal.component.tsx | 5 +- .../PossibleImpersonationAttackModal.test.tsx | 11 ---- .../possibleImpersonationAttack.test.tsx | 6 ++- .../PossibleImpersonationAttack.component.tsx | 3 +- .../PossibleImpersonationAttack.test.tsx | 53 ------------------- 6 files changed, 13 insertions(+), 69 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6187fa682..a3fe296403 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +[unreleased] + +* Temporarily hiding leave community button from Possible impersonation attack + [2.0.3-alpha.0] * Filter CSRs - remove old csrs and replace with new for each pubkey diff --git a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.component.tsx b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.component.tsx index 2c3b45a692..6d11297b49 100644 --- a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.component.tsx +++ b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.component.tsx @@ -69,9 +69,10 @@ const PossibleImpersonationAttackModalComponent: React.FC This should never happen and we recommend leaving this community immediately! - + */} ) diff --git a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.test.tsx b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.test.tsx index 5a5e512164..03035079a6 100644 --- a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.test.tsx +++ b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.test.tsx @@ -121,17 +121,6 @@ describe('PossibleImpersonationAttackModal', () => { This should never happen and we recommend leaving this community immediately!

- diff --git a/packages/desktop/src/rtl-tests/possibleImpersonationAttack.test.tsx b/packages/desktop/src/rtl-tests/possibleImpersonationAttack.test.tsx index 4e1a8af679..d6f1005cfa 100644 --- a/packages/desktop/src/rtl-tests/possibleImpersonationAttack.test.tsx +++ b/packages/desktop/src/rtl-tests/possibleImpersonationAttack.test.tsx @@ -99,7 +99,9 @@ describe('Possible Impersonation Attack', () => { const modal = screen.getByTestId('possible-impersonation-attack-modal-component') expect(modal).toBeVisible() - const button = screen.getByTestId('unregistered-button') - expect(button).toBeVisible() + // Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 */ + + // const button = screen.getByTestId('unregistered-button') + // expect(button).toBeVisible() }) }) diff --git a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx index 5899f6b117..b3ad735bb3 100644 --- a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx +++ b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx @@ -62,7 +62,8 @@ const PossibleImpersonationAttackComponent: React.FC This should never happen and we recommend leaving this community immediately! - */} ) diff --git a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.container.tsx b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.container.tsx index bd7b75f913..4fefa42f1f 100644 --- a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.container.tsx +++ b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.container.tsx @@ -2,7 +2,6 @@ import { capitalizeFirstLetter } from '@quiet/common' import { communities, users } from '@quiet/state-manager' import React, { useEffect } from 'react' import { useSelector } from 'react-redux' -import { clearCommunity } from '../../..' import { useModal } from '../../../containers/hooks' import { ModalName } from '../../../sagas/modals/modals.types' import PossibleImpersonationAttackModalComponent from './PossibleImpersonationAttackModal.component' @@ -19,10 +18,6 @@ const PossibleImpersonationAttackModalContainer = () => { communityName = capitalizeFirstLetter(community.name) } - const leaveCommunity = async () => { - await clearCommunity() - } - useEffect(() => { if (duplicateCerts) { possibleImpersonationAttackModal.handleOpen() @@ -30,11 +25,7 @@ const PossibleImpersonationAttackModalContainer = () => { }, [duplicateCerts]) return ( - + ) } diff --git a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.stories.tsx b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.stories.tsx index bd94e8c525..68ab58500f 100644 --- a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.stories.tsx +++ b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.stories.tsx @@ -19,7 +19,6 @@ const args: PossibleImpersonationAttackModalComponentProps = { handleClose: function (): void {}, open: true, communityName: 'devteam', - leaveCommunity: function (): void {}, } Component.args = args diff --git a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.test.tsx b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.test.tsx index 03035079a6..e739fbc416 100644 --- a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.test.tsx +++ b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.test.tsx @@ -8,12 +8,7 @@ describe('PossibleImpersonationAttackModal', () => { it('renderComponent', () => { const result = renderComponent( - {}} - open={true} - communityName={'devteam'} - leaveCommunity={() => {}} - /> + {}} open={true} communityName={'devteam'} /> ) expect(result.baseElement).toMatchInlineSnapshot(` diff --git a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx index b3ad735bb3..a154591ac6 100644 --- a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx +++ b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx @@ -35,7 +35,6 @@ const classes = StyleSheet.create({ const PossibleImpersonationAttackComponent: React.FC = ({ handleBackButton, communityName, - leaveCommunity, }) => { return ( {/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 */} - {/*