File tree 4 files changed +28
-1
lines changed
4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " osmcha-frontend" ,
3
- "version" : " 0.56.1 " ,
3
+ "version" : " 0.56.2 " ,
4
4
"license" : " ISC" ,
5
5
"engines" : {
6
6
"node" : " >=7.0"
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ export const overpassBase = '//overpass.maptime.in/api/interpreter';
6
6
export const osmBase = '//www.openstreetmap.org/api/0.6/' ;
7
7
export const mapboxAccessToken =
8
8
'pk.eyJ1Ijoib3BlbnN0cmVldG1hcCIsImEiOiJjam10OXpmc2YwMXI5M3BqeTRiMDBqMHVyIn0.LIcIDe3TZLSDdTWDoojzNg' ;
9
+ export const statusUrl =
10
+ 'https://raw.githubusercontent.com/mapbox/osmcha-frontend/status/status.json' ;
9
11
10
12
export const osmchaSocialTokenUrl = `${ API_URL } /social-auth/` ;
11
13
Original file line number Diff line number Diff line change
1
+ import { statusUrl } from '../config/constants' ;
2
+ import { handleErrors } from './aoi' ;
3
+
4
+ export function getStatus ( input , type ) : Promise < * > {
5
+ return fetch ( `${ statusUrl } ` , {
6
+ method : 'GET'
7
+ } )
8
+ . then ( handleErrors )
9
+ . then ( response => {
10
+ return response . json ( ) ;
11
+ } ) ;
12
+ }
Original file line number Diff line number Diff line change 9
9
fetchUserDetails ,
10
10
updateUserDetails
11
11
} from '../network/auth' ;
12
+ import { getStatus } from '../network/status' ;
12
13
import { fetchChangeset } from '../network/changeset' ;
13
14
import { fetchBlackList } from '../network/osmcha_blacklist' ;
14
15
import { setItem , removeItem } from '../utils/safe_storage' ;
@@ -87,6 +88,7 @@ export function* watchAuth(): any {
87
88
const userDetails = fromJS ( yield call ( fetchUserDetails , token ) ) ;
88
89
const whitelist = userDetails . get ( 'whitelists' ) ;
89
90
const blacklist = fromJS ( yield call ( fetchBlackList , token ) ) ;
91
+ const status = fromJS ( yield call ( getStatus ) ) ;
90
92
yield put ( action ( WHITELIST . define , { whitelist } ) ) ;
91
93
yield put ( action ( BLACKLIST . define , { blacklist } ) ) ;
92
94
yield put ( action ( AUTH . userDetails , { userDetails } ) ) ;
@@ -104,6 +106,17 @@ export function* watchAuth(): any {
104
106
} )
105
107
) ;
106
108
}
109
+ // show status notification
110
+ if ( status . get ( 'status' ) !== 'success' ) {
111
+ yield put (
112
+ modal ( {
113
+ title : 'Status alert' ,
114
+ description : status . get ( 'message' ) ,
115
+ kind : status . get ( 'status' ) ,
116
+ autoDismiss : 20
117
+ } )
118
+ ) ;
119
+ }
107
120
108
121
yield take ( AUTH . logout ) ;
109
122
delayBy = DELAY ;
You can’t perform that action at this time.
0 commit comments