aboutsummaryrefslogtreecommitdiffstats
path: root/packages/renderer/src/components/BrowserViewPlaceholder.tsx
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-03-14 17:59:22 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-03-15 03:00:05 +0100
commitd2213e7eba2ec8b478c879397dc0de64d293f367 (patch)
tree5e32ece325fa11f13117b2c9e5966d7142826af4 /packages/renderer/src/components/BrowserViewPlaceholder.tsx
parentfeat(renderer): Back and forward mouse buttons (diff)
downloadsophie-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.tsx26
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
21import Box from '@mui/material/Box'; 21import Box from '@mui/material/Box';
22import throttle from 'lodash-es/throttle'; 22import throttle from 'lodash-es/throttle';
23import { observer } from 'mobx-react-lite'; 23import React, { ReactNode, useCallback, useRef } from 'react';
24import React, { useCallback, useRef } from 'react';
25 24
26import { useStore } from './StoreProvider'; 25import { useStore } from './StoreProvider';
27 26
28export default observer(() => { 27function 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
74BrowserViewPlaceholder.defaultProps = {
75 children: undefined,
76};
77
78export default BrowserViewPlaceholder;