-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(front): show an error if db is not responding
- Loading branch information
Showing
11 changed files
with
200 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { apiFetchJSON } from '../api'; | ||
|
||
export const ROC_ONLINE = 'ROC_ONLINE'; | ||
|
||
export function getRocStatus() { | ||
return async (dispatch) => { | ||
try { | ||
const result = await apiFetchJSON('auth/session'); | ||
dispatch({ type: ROC_ONLINE, payload: !!result.ok }); | ||
} catch (e) { | ||
dispatch({ type: ROC_ONLINE, payload: false }); | ||
} | ||
setTimeout(() => dispatch(getRocStatus()), 10000); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ROC_ONLINE } from '../actions/main'; | ||
|
||
const initialState = { | ||
rocOnline: null | ||
}; | ||
|
||
const mainReducer = (state = initialState, action) => { | ||
switch (action.type) { | ||
case ROC_ONLINE: | ||
return { ...state, rocOnline: action.payload }; | ||
default: | ||
return state; | ||
} | ||
}; | ||
|
||
export default mainReducer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.