12
12
* Copyright (c) 2014-2019. All rights reserved.
13
13
*/
14
14
15
- import React from 'react'
16
- import ReactDOM from 'react-dom'
17
- import { applyMiddleware , createStore , compose } from 'redux'
18
- import { Provider } from 'react-redux'
19
- import createSagaMiddleware from 'redux-saga'
20
- import { middleware as thunkMiddleware } from 'redux-saga-thunk'
21
- import IndexReducer from './reducers'
22
- import IndexSagas from './sagas'
23
- import { SingletonHooksContainer } from 'react-singleton-hook'
24
- import TopbarContainer from './containers/Topbar/TopbarContainer'
25
- import Sidebar from './components/Nav/Sidebar/index.jsx'
26
- import ModalRoot from './containers/Modals'
27
- import renderer from './renderer'
28
-
29
- import SocketGlobal from 'containers/Global/SocketGlobal'
30
- import SessionLoader from 'lib2/sessionLoader'
31
- import HotKeysGlobal from 'containers/Global/HotKeysGlobal'
32
- import BackupRestoreOverlay from 'containers/Global/BackupRestoreOverlay'
33
- import ChatDock from 'containers/Global/ChatDock'
34
-
35
- const sagaMiddleware = createSagaMiddleware ( )
15
+ import React from 'react' ;
16
+ import ReactDOM from 'react-dom' ;
17
+ import { applyMiddleware , createStore , compose } from 'redux' ;
18
+ import { Provider } from 'react-redux' ;
19
+ import createSagaMiddleware from 'redux-saga' ;
20
+ import { middleware as thunkMiddleware } from 'redux-saga-thunk' ;
21
+ import IndexReducer from './reducers' ;
22
+ import IndexSagas from './sagas' ;
23
+ import { SingletonHooksContainer } from 'react-singleton-hook' ;
24
+ import TopbarContainer from './containers/Topbar/TopbarContainer' ;
25
+ import Sidebar from './components/Nav/Sidebar/index.jsx' ;
26
+ import ModalRoot from './containers/Modals' ;
27
+ import renderer from './renderer' ;
28
+
29
+ import SocketGlobal from 'containers/Global/SocketGlobal' ;
30
+ import SessionLoader from 'lib2/sessionLoader' ;
31
+ import HotKeysGlobal from 'containers/Global/HotKeysGlobal' ;
32
+ import BackupRestoreOverlay from 'containers/Global/BackupRestoreOverlay' ;
33
+ import ChatDock from 'containers/Global/ChatDock' ;
34
+
35
+ const sagaMiddleware = createSagaMiddleware ( ) ;
36
36
37
37
/*eslint-disable */
38
38
const composeSetup =
39
39
process . env . NODE_ENV !== 'production' && typeof window === 'object' && window . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__
40
40
? window . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__
41
- : compose
41
+ : compose ;
42
42
/*eslint-enable */
43
43
44
44
// if (process.env.NODE_ENV !== 'production') {
45
- localStorage . setItem ( 'debug' , 'trudesk:*' ) // Enable logger
45
+ localStorage . setItem ( 'debug' , 'trudesk:*' ) ; // Enable logger
46
46
// }
47
47
48
- const store = createStore ( IndexReducer , composeSetup ( applyMiddleware ( thunkMiddleware , sagaMiddleware ) ) )
48
+ const store = createStore ( IndexReducer , composeSetup ( applyMiddleware ( thunkMiddleware , sagaMiddleware ) ) ) ;
49
49
50
50
// This is need to call an action from angular
51
51
// Goal: remove this once angular is fully removed
52
- window . react . redux = { store }
52
+ window . react . redux = { store } ;
53
53
54
- sagaMiddleware . run ( IndexSagas )
54
+ sagaMiddleware . run ( IndexSagas ) ;
55
55
56
56
// Mount Globals
57
57
if ( document . getElementById ( 'globals' ) ) {
@@ -67,39 +67,39 @@ if (document.getElementById('globals')) {
67
67
< BackupRestoreOverlay />
68
68
</ >
69
69
</ Provider >
70
- )
70
+ ) ;
71
71
72
- ReactDOM . render ( GlobalsRoot , document . getElementById ( 'globals' ) )
72
+ ReactDOM . render ( GlobalsRoot , document . getElementById ( 'globals' ) ) ;
73
73
}
74
74
75
75
const sidebarWithProvider = (
76
76
< Provider store = { store } >
77
77
< Sidebar />
78
78
</ Provider >
79
- )
79
+ ) ;
80
80
81
- ReactDOM . render ( sidebarWithProvider , document . getElementById ( 'sidebar' ) )
81
+ ReactDOM . render ( sidebarWithProvider , document . getElementById ( 'sidebar' ) ) ;
82
82
83
83
if ( document . getElementById ( 'modal-wrapper' ) ) {
84
84
const RootModal = (
85
85
< Provider store = { store } >
86
86
< ModalRoot />
87
87
</ Provider >
88
- )
89
- ReactDOM . render ( RootModal , document . getElementById ( 'modal-wrapper' ) )
88
+ ) ;
89
+ ReactDOM . render ( RootModal , document . getElementById ( 'modal-wrapper' ) ) ;
90
90
}
91
91
92
92
if ( document . getElementById ( 'topbar' ) ) {
93
93
const TopbarRoot = (
94
94
< Provider store = { store } >
95
95
< TopbarContainer />
96
96
</ Provider >
97
- )
97
+ ) ;
98
98
99
- ReactDOM . render ( TopbarRoot , document . getElementById ( 'topbar' ) )
99
+ ReactDOM . render ( TopbarRoot , document . getElementById ( 'topbar' ) ) ;
100
100
}
101
101
102
- window . react . renderer = renderer
103
- window . react . dom = ReactDOM
102
+ window . react . renderer = renderer ;
103
+ window . react . dom = ReactDOM ;
104
104
105
- renderer ( store )
105
+ renderer ( store ) ;
0 commit comments