@@ -47,11 +47,9 @@ import {
47
47
buildImportDataInClassroomPath ,
48
48
} from './config/paths' ;
49
49
import {
50
- getGeolocation ,
51
50
getUserFolder ,
52
51
getLanguage ,
53
52
getDeveloperMode ,
54
- getGeolocationEnabled ,
55
53
isAuthenticated ,
56
54
} from './actions' ;
57
55
import { DEFAULT_LANGUAGE , USER_MODES , PRODUCT_NAME } from './config/constants' ;
@@ -89,17 +87,14 @@ export class App extends Component {
89
87
state = { height : 0 , isDownloadingUpdate : false } ;
90
88
91
89
static propTypes = {
92
- dispatchGetGeolocation : PropTypes . func . isRequired ,
93
90
dispatchGetUserFolder : PropTypes . func . isRequired ,
94
91
dispatchGetLanguage : PropTypes . func . isRequired ,
95
92
dispatchGetDeveloperMode : PropTypes . func . isRequired ,
96
- dispatchGetGeolocationEnabled : PropTypes . func . isRequired ,
97
93
dispatchIsAuthenticated : PropTypes . func . isRequired ,
98
94
lang : PropTypes . string ,
99
95
i18n : PropTypes . shape ( {
100
96
changeLanguage : PropTypes . func . isRequired ,
101
97
} ) . isRequired ,
102
- geolocationEnabled : PropTypes . bool . isRequired ,
103
98
classes : PropTypes . shape ( {
104
99
toastrIcon : PropTypes . string . isRequired ,
105
100
fullScreen : PropTypes . string . isRequired ,
@@ -119,7 +114,6 @@ export class App extends Component {
119
114
dispatchGetUserFolder,
120
115
dispatchGetLanguage,
121
116
dispatchGetDeveloperMode,
122
- dispatchGetGeolocationEnabled,
123
117
dispatchIsAuthenticated,
124
118
userMode,
125
119
} = this . props ;
@@ -128,7 +122,6 @@ export class App extends Component {
128
122
dispatchGetLanguage ( ) ;
129
123
dispatchGetDeveloperMode ( ) ;
130
124
dispatchGetUserFolder ( ) ;
131
- dispatchGetGeolocationEnabled ( ) ;
132
125
133
126
if ( userMode === USER_MODES . TEACHER ) {
134
127
this . checkAppUpgrade ( ) ;
@@ -142,27 +135,14 @@ export class App extends Component {
142
135
143
136
componentDidUpdate ( {
144
137
lang : prevLang ,
145
- geolocationEnabled : prevGeolocationEnabled ,
146
- dispatchGetGeolocation,
147
138
connexionStatus : prevConnexionStatus ,
148
139
userMode : prevUserMode ,
149
140
} ) {
150
- const {
151
- lang,
152
- i18n,
153
- geolocationEnabled,
154
- connexionStatus,
155
- userMode,
156
- } = this . props ;
141
+ const { lang, i18n, connexionStatus, userMode } = this . props ;
157
142
if ( lang !== prevLang ) {
158
143
i18n . changeLanguage ( lang ) ;
159
144
}
160
145
161
- // fetch geolocation only if enabled
162
- if ( geolocationEnabled && geolocationEnabled !== prevGeolocationEnabled ) {
163
- dispatchGetGeolocation ( ) ;
164
- }
165
-
166
146
// display toastr when connexion status changes
167
147
if ( connexionStatus !== prevConnexionStatus ) {
168
148
this . triggerConnectionToastr ( ) ;
@@ -353,20 +333,13 @@ export class App extends Component {
353
333
354
334
const mapStateToProps = ( { authentication } ) => ( {
355
335
lang : authentication . getIn ( [ 'user' , 'settings' , 'lang' ] ) ,
356
- geolocationEnabled : authentication . getIn ( [
357
- 'user' ,
358
- 'settings' ,
359
- 'geolocationEnabled' ,
360
- ] ) ,
361
336
userMode : authentication . getIn ( [ 'user' , 'settings' , 'userMode' ] ) ,
362
337
} ) ;
363
338
364
339
const mapDispatchToProps = {
365
- dispatchGetGeolocation : getGeolocation ,
366
340
dispatchGetUserFolder : getUserFolder ,
367
341
dispatchGetLanguage : getLanguage ,
368
342
dispatchGetDeveloperMode : getDeveloperMode ,
369
- dispatchGetGeolocationEnabled : getGeolocationEnabled ,
370
343
dispatchIsAuthenticated : isAuthenticated ,
371
344
} ;
372
345
0 commit comments