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!
-
- Leave community
-
-
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!
-
+ {/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 */}
+ {/* */}
)
diff --git a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.test.tsx b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.test.tsx
index 088afdc2e7..d758f4e5e5 100644
--- a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.test.tsx
+++ b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.test.tsx
@@ -263,59 +263,6 @@ describe('PossibleImpersonationAttack component', () => {
>
This should never happen and we recommend leaving this community immediately!
-
-
- Leave community
-
-
`)
From 499a12ff5494611af5d302244bc05024bcbc4c82 Mon Sep 17 00:00:00 2001
From: Kacper Michalik
Date: Mon, 6 Nov 2023 14:35:10 +0100
Subject: [PATCH 2/6] feat: remove button from screen and modal
---
.../PossibleImpersonationAttackModal.component.tsx | 5 -----
.../PossibleImpersonationAttackModal.container.tsx | 11 +----------
.../PossibleImpersonationAttackModal.stories.tsx | 1 -
.../PossibleImpersonationAttackModal.test.tsx | 7 +------
.../PossibleImpersonationAttack.component.tsx | 2 --
.../PossibleImpersonationAttack.screen.tsx | 14 +-------------
.../PossibleImpersonationAttack.types.ts | 1 -
7 files changed, 3 insertions(+), 38 deletions(-)
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 6d11297b49..03f6d6b28a 100644
--- a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.component.tsx
+++ b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.component.tsx
@@ -40,14 +40,12 @@ const StyledGrid = styled(Grid)(({ theme }) => ({
export interface PossibleImpersonationAttackModalComponentProps {
communityName: string
- leaveCommunity: () => void
open: boolean
handleClose: () => void
}
const PossibleImpersonationAttackModalComponent: React.FC = ({
communityName,
- leaveCommunity,
handleClose,
open,
}) => {
@@ -70,9 +68,6 @@ const PossibleImpersonationAttackModalComponent: React.FCThis should never happen and we recommend leaving this community immediately!
{/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 */}
- {/*
- Leave community
- */}
)
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 */}
- {/* */}
)
diff --git a/packages/mobile/src/screens/PossibleImpersonationAttack/PossibleImpersonationAttack.screen.tsx b/packages/mobile/src/screens/PossibleImpersonationAttack/PossibleImpersonationAttack.screen.tsx
index c6148bd8eb..b9942e9700 100644
--- a/packages/mobile/src/screens/PossibleImpersonationAttack/PossibleImpersonationAttack.screen.tsx
+++ b/packages/mobile/src/screens/PossibleImpersonationAttack/PossibleImpersonationAttack.screen.tsx
@@ -1,10 +1,8 @@
import React, { FC, useCallback } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { navigationActions } from '../../store/navigation/navigation.slice'
-import { ScreenNames } from '../../const/ScreenNames.enum'
import { capitalizeFirstLetter } from '@quiet/common'
import { communities } from '@quiet/state-manager'
-import { nativeServicesActions } from '../../store/nativeServices/nativeServices.slice'
import { PossibleImpersonationAttackScreenProps } from './PossibleImpersonationAttack.types'
import PossibleImpersonationAttackComponent from '../../components/PossibleImpersonationAttack/PossibleImpersonationAttack.component'
@@ -18,19 +16,9 @@ export const PossibleImpersonationAttackScreen: FC {
- dispatch(nativeServicesActions.leaveCommunity())
- }, [dispatch])
-
const handleBackButton = useCallback(() => {
dispatch(navigationActions.pop())
}, [dispatch])
- return (
-
- )
+ return
}
diff --git a/packages/mobile/src/screens/PossibleImpersonationAttack/PossibleImpersonationAttack.types.ts b/packages/mobile/src/screens/PossibleImpersonationAttack/PossibleImpersonationAttack.types.ts
index 4a0638b6c8..3fa12a4344 100644
--- a/packages/mobile/src/screens/PossibleImpersonationAttack/PossibleImpersonationAttack.types.ts
+++ b/packages/mobile/src/screens/PossibleImpersonationAttack/PossibleImpersonationAttack.types.ts
@@ -6,5 +6,4 @@ export interface PossibleImpersonationAttackScreenProps {
export interface PossibleImpersonationAttackComponentProps {
handleBackButton: () => void
communityName: string
- leaveCommunity: () => void
}
From 4fc9f8beccef7c5b98568fd73419ae03c30df52c Mon Sep 17 00:00:00 2001
From: Kacper Michalik
Date: Mon, 6 Nov 2023 14:38:52 +0100
Subject: [PATCH 3/6] docs: add link to commit
---
.../PossibleImpersonationAttackModal.component.tsx | 2 +-
.../PossibleImpersonationAttack.component.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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 03f6d6b28a..aa87284b7a 100644
--- a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.component.tsx
+++ b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.component.tsx
@@ -67,7 +67,7 @@ const PossibleImpersonationAttackModalComponent: React.FC
This should never happen and we recommend leaving this community immediately!
- {/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 */}
+ {/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 , https://github.com/TryQuiet/quiet/pull/2037/commits/499a12ff5494611af5d302244bc05024bcbc4c82*/}
)
diff --git a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx
index a154591ac6..c3eccbb0f0 100644
--- a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx
+++ b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx
@@ -61,7 +61,7 @@ const PossibleImpersonationAttackComponent: React.FC
This should never happen and we recommend leaving this community immediately!
- {/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 */}
+ {/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 , https://github.com/TryQuiet/quiet/pull/2037/commits/499a12ff5494611af5d302244bc05024bcbc4c82*/}
)
From 6ef8c09be00abbd328359200708e5005519603f2 Mon Sep 17 00:00:00 2001
From: Kacper Michalik
Date: Mon, 6 Nov 2023 14:41:05 +0100
Subject: [PATCH 4/6] fix: rtl test cleanup
---
.../src/rtl-tests/possibleImpersonationAttack.test.tsx | 5 -----
1 file changed, 5 deletions(-)
diff --git a/packages/desktop/src/rtl-tests/possibleImpersonationAttack.test.tsx b/packages/desktop/src/rtl-tests/possibleImpersonationAttack.test.tsx
index d6f1005cfa..fb3d7a482f 100644
--- a/packages/desktop/src/rtl-tests/possibleImpersonationAttack.test.tsx
+++ b/packages/desktop/src/rtl-tests/possibleImpersonationAttack.test.tsx
@@ -98,10 +98,5 @@ describe('Possible Impersonation Attack', () => {
const modal = screen.getByTestId('possible-impersonation-attack-modal-component')
expect(modal).toBeVisible()
-
- // Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 */
-
- // const button = screen.getByTestId('unregistered-button')
- // expect(button).toBeVisible()
})
})
From fc51b0b627880198f7d3ec950b35db227d7daf82 Mon Sep 17 00:00:00 2001
From: Kacper Michalik
Date: Mon, 6 Nov 2023 14:47:20 +0100
Subject: [PATCH 5/6] fix: cleanup
---
.../PossibleImpersonationAttackModal.component.tsx | 2 +-
.../PossibleImpersonationAttack.component.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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 aa87284b7a..03f6d6b28a 100644
--- a/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.component.tsx
+++ b/packages/desktop/src/renderer/components/widgets/possibleImpersonationAttackModal/PossibleImpersonationAttackModal.component.tsx
@@ -67,7 +67,7 @@ const PossibleImpersonationAttackModalComponent: React.FC
This should never happen and we recommend leaving this community immediately!
- {/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 , https://github.com/TryQuiet/quiet/pull/2037/commits/499a12ff5494611af5d302244bc05024bcbc4c82*/}
+ {/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 */}
)
diff --git a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx
index c3eccbb0f0..a154591ac6 100644
--- a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx
+++ b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.component.tsx
@@ -61,7 +61,7 @@ const PossibleImpersonationAttackComponent: React.FC
This should never happen and we recommend leaving this community immediately!
- {/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 , https://github.com/TryQuiet/quiet/pull/2037/commits/499a12ff5494611af5d302244bc05024bcbc4c82*/}
+ {/* Temporarily hiding button - https://github.com/TryQuiet/quiet/issues/2025 */}
)
From dfbd1bd0765e4dbaa5c6edbf641d33026ad72331 Mon Sep 17 00:00:00 2001
From: Kacper Michalik
Date: Mon, 6 Nov 2023 15:00:04 +0100
Subject: [PATCH 6/6] fix: cleanup
---
.../PossibleImpersonationAttack.stories.tsx | 2 +-
.../PossibleImpersonationAttack.test.tsx | 6 +-----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.stories.tsx b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.stories.tsx
index c989eaf969..fa1a93c8f7 100644
--- a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.stories.tsx
+++ b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.stories.tsx
@@ -3,5 +3,5 @@ import React from 'react'
import PossibleImpersonationAttackComponent from './PossibleImpersonationAttack.component'
storiesOf('PossibleImpersonationAttack', module).add('Default', () => (
- {}} handleBackButton={() => {}} />
+ {}} />
))
diff --git a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.test.tsx b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.test.tsx
index d758f4e5e5..cb2e334f0c 100644
--- a/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.test.tsx
+++ b/packages/mobile/src/components/PossibleImpersonationAttack/PossibleImpersonationAttack.test.tsx
@@ -5,11 +5,7 @@ import PossibleImpersonationAttackComponent from './PossibleImpersonationAttack.
describe('PossibleImpersonationAttack component', () => {
it('renders properly', () => {
const { toJSON } = renderComponent(
- {}}
- leaveCommunity={() => {}}
- />
+ {}} />
)
expect(toJSON()).toMatchInlineSnapshot(`