-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplication.js
47 lines (38 loc) · 1.42 KB
/
application.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// -------------------------------------------------------------
// This is the outer application wrapper for Gatekeeper.
// It kicks off the react application.
// -------------------------------------------------------------
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import { createStore, applyMiddleware } from 'redux'
import Application from './containers/application-container.jsx'
import applicationReducer from './reducers/application-reducer'
import './scss/container.scss'
import { setStore, api } from './api/web-api.js'
import { initialize } from './lib/global-keyboard-listener'
const store = createStore(applicationReducer)
window.store = store
setStore(store)
document.addEventListener("DOMContentLoaded", async () => {
ReactDOM.render(<Provider store={store}><Application /></Provider>, document.getElementById('container-outer'))
store.dispatch({ type: 'SET_API', payload: { api } })
await api.getSession()
initialize()
})
document.addEventListener('dragleave', function (event) {
event.preventDefault();
return false;
}, false);
document.addEventListener('dragend', function (event) {
event.preventDefault();
return false;
}, false);
document.addEventListener('dragover', function (event) {
event.preventDefault();
return false;
}, false);
document.addEventListener('drop', function (event) {
event.preventDefault();
return false;
}, false);