@@ -7,6 +7,7 @@ import messageHandler from 'baselayer/MessageHandler';
7
7
import WebSocket from 'baselayer/components/WebSocket' ;
8
8
import { Notifications , showNotification } from 'baselayer/components/Notifications' ;
9
9
10
+ import * as API from 'baselayer/API' ;
10
11
import configureStore from '../store' ;
11
12
import '../customMessageHandler' ;
12
13
@@ -19,7 +20,6 @@ import Examples from '../containers/Examples';
19
20
20
21
import * as Action from '../actions' ;
21
22
22
- import * as API from 'baselayer/API' ;
23
23
24
24
// Set up store and message handling
25
25
@@ -38,18 +38,19 @@ class MainContent extends React.Component {
38
38
}
39
39
40
40
render ( ) {
41
+ const { root } = this . props ;
41
42
return (
42
43
< div >
43
44
44
45
< div style = { { float : "right" } } >
45
46
< b > WebSocket connection: </ b >
46
47
< WebSocket
47
- url = { `${ window . location . protocol === 'https:' ? 'wss' : 'ws' } ://${ this . props . root } websocket` }
48
- auth_url = { `${ window . location . protocol } //${ this . props . root } baselayer/socket_auth_token` }
48
+ url = { `${ window . location . protocol === 'https:' ? 'wss' : 'ws' } ://${ root } websocket` }
49
+ auth_url = { `${ window . location . protocol } //${ root } baselayer/socket_auth_token` }
49
50
messageHandler = { messageHandler }
50
51
dispatch = { store . dispatch }
51
- />
52
- < Profile />
52
+ />
53
+ < Profile />
53
54
</ div >
54
55
55
56
< Notifications style = { { } } />
@@ -60,6 +61,7 @@ class MainContent extends React.Component {
60
61
< h3 > Example of a frontend-generated notification</ h3 >
61
62
62
63
< button
64
+ type = "button"
63
65
href = "#"
64
66
onClick = { ( ) => store . dispatch ( showNotification ( "Hello from Baselayer" ) ) }
65
67
>
@@ -69,6 +71,7 @@ class MainContent extends React.Component {
69
71
< h3 > Example of a backend-generated notification</ h3 >
70
72
71
73
< button
74
+ type = "button"
72
75
href = "#"
73
76
onClick = { ( ) => { store . dispatch ( API . GET ( '/push_notification' , 'PUSH_NOTIFICATION' ) ) ; } }
74
77
>
0 commit comments