diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-03-14 17:59:22 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-03-15 03:00:05 +0100 |
commit | d2213e7eba2ec8b478c879397dc0de64d293f367 (patch) | |
tree | 5e32ece325fa11f13117b2c9e5966d7142826af4 /packages/renderer/src/components/BrowserViewPlaceholder.tsx | |
parent | feat(renderer): Back and forward mouse buttons (diff) | |
download | sophie-d2213e7eba2ec8b478c879397dc0de64d293f367.tar.gz sophie-d2213e7eba2ec8b478c879397dc0de64d293f367.tar.zst sophie-d2213e7eba2ec8b478c879397dc0de64d293f367.zip |
feat: Temporary certificate acceptance backend
We use the 'certificate-error' event of webContents to detect
certificate verification errors and display a message to manually trust
the certificate.
Certificates are trusted per profile and only until Sophie is restarted.
We still need to build the associated UI, the current one is just a
rough prototype for debugging.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/renderer/src/components/BrowserViewPlaceholder.tsx')
-rw-r--r-- | packages/renderer/src/components/BrowserViewPlaceholder.tsx | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/packages/renderer/src/components/BrowserViewPlaceholder.tsx b/packages/renderer/src/components/BrowserViewPlaceholder.tsx index c07ed15..1f5f9f4 100644 --- a/packages/renderer/src/components/BrowserViewPlaceholder.tsx +++ b/packages/renderer/src/components/BrowserViewPlaceholder.tsx | |||
@@ -20,12 +20,15 @@ | |||
20 | 20 | ||
21 | import Box from '@mui/material/Box'; | 21 | import Box from '@mui/material/Box'; |
22 | import throttle from 'lodash-es/throttle'; | 22 | import throttle from 'lodash-es/throttle'; |
23 | import { observer } from 'mobx-react-lite'; | 23 | import React, { ReactNode, useCallback, useRef } from 'react'; |
24 | import React, { useCallback, useRef } from 'react'; | ||
25 | 24 | ||
26 | import { useStore } from './StoreProvider'; | 25 | import { useStore } from './StoreProvider'; |
27 | 26 | ||
28 | export default observer(() => { | 27 | function BrowserViewPlaceholder({ |
28 | children, | ||
29 | }: { | ||
30 | children?: ReactNode; | ||
31 | }): JSX.Element { | ||
29 | const store = useStore(); | 32 | const store = useStore(); |
30 | 33 | ||
31 | // eslint-disable-next-line react-hooks/exhaustive-deps -- react-hooks doesn't support `throttle`. | 34 | // eslint-disable-next-line react-hooks/exhaustive-deps -- react-hooks doesn't support `throttle`. |
@@ -62,11 +65,14 @@ export default observer(() => { | |||
62 | ); | 65 | ); |
63 | 66 | ||
64 | return ( | 67 | return ( |
65 | <Box | 68 | <Box flex={1} ref={ref}> |
66 | sx={{ | 69 | {children} |
67 | flex: 1, | 70 | </Box> |
68 | }} | ||
69 | ref={ref} | ||
70 | /> | ||
71 | ); | 71 | ); |
72 | }); | 72 | } |
73 | |||
74 | BrowserViewPlaceholder.defaultProps = { | ||
75 | children: undefined, | ||
76 | }; | ||
77 | |||
78 | export default BrowserViewPlaceholder; | ||