11import { remote } from 'electron' ;
22import i18n from 'i18next' ;
3- import React , { useEffect , useState , Component } from 'react' ;
3+ import React , { useEffect , useState } from 'react' ;
44import { I18nextProvider , useTranslation } from 'react-i18next' ;
55import { Provider , useDispatch } from 'react-redux' ;
66import { call , put , select , takeEvery } from 'redux-saga/effects' ;
@@ -17,20 +17,15 @@ import {
1717 WEBVIEW_CERTIFICATE_TRUSTED ,
1818} from '../actions' ;
1919import { MainWindow } from './MainWindow' ;
20- import { AboutDialog } from './AboutDialog' ;
21- import { ScreenSharingDialog } from './ScreenSharingDialog' ;
22- import { UpdateDialog } from './UpdateDialog' ;
23- import { SideBar } from './SideBar' ;
24- import { ServersView } from './ServersView' ;
25- import { AddServerView } from './AddServerView' ;
2620import { TrayIcon } from './TrayIcon' ;
2721import { MenuBar } from './MenuBar' ;
2822import { Dock } from './Dock' ;
2923import { TouchBar } from './TouchBar' ;
3024import { createReduxStoreAndSagaMiddleware } from '../storeAndEffects' ;
3125import { SagaMiddlewareProvider , useSaga } from './SagaMiddlewareProvider' ;
3226import { validateServerUrl } from '../sagas/servers' ;
33- import { SelectClientCertificateDialog } from './SelectClientCertificateDialog' ;
27+ import { Shell } from './Shell' ;
28+ import { ErrorCatcher } from './utils/ErrorCatcher' ;
3429
3530function AppContent ( ) {
3631 const { t } = useTranslation ( ) ;
@@ -148,34 +143,13 @@ function AppContent() {
148143
149144 return < MainWindow >
150145 < MenuBar />
151- < SideBar />
152- < ServersView />
153- < AddServerView />
154- < AboutDialog />
155- < ScreenSharingDialog />
156- < SelectClientCertificateDialog />
157- < UpdateDialog />
146+ < Shell />
158147 < Dock />
159148 < TrayIcon />
160149 < TouchBar />
161150 </ MainWindow > ;
162151}
163152
164- class ErrorCatcher extends Component {
165- componentDidCatch ( error , errorInfo ) {
166- console . error ( error ) ;
167- console . error ( errorInfo . componentStack ) ;
168- remote . dialog . showErrorBox ( error . message , error . stack ) ;
169- process . exit ( 1 ) ;
170- }
171-
172- render ( ) {
173- return < >
174- { this . props . children }
175- </ > ;
176- }
177- }
178-
179153export function App ( ) {
180154 const [ [ store , sagaMiddleware ] ] = useState ( ( ) => createReduxStoreAndSagaMiddleware ( ) ) ;
181155
0 commit comments