From d173b061298212c20246e07163aea4afd362798a Mon Sep 17 00:00:00 2001 From: mgerb42 Date: Sat, 27 Aug 2016 07:30:32 +0000 Subject: [PATCH] added check fetching functionality --- client/js/pages/Index.js | 8 ++++++-- client/js/redux/actions.js | 8 ++++++++ client/js/redux/constants.js | 1 + client/js/redux/reducers.js | 20 +++++++++++++++----- client/js/redux/store.js | 3 ++- package.json | 1 + 6 files changed, 33 insertions(+), 8 deletions(-) diff --git a/client/js/pages/Index.js b/client/js/pages/Index.js index 5f54e1a..332f5eb 100644 --- a/client/js/pages/Index.js +++ b/client/js/pages/Index.js @@ -33,12 +33,16 @@ export default class Index extends React.Component { } render() { + const fetched = this.props.redux.fetched; + const fetching = this.props.redux.fetching; + return (
- {typeof this.page === 'undefined' ? : ""} - {this.page === 'post' ? : ""} + {typeof this.page === 'undefined' && !fetching ? : null} + {this.page === 'post' && !fetching ? : null} + {fetching ?
Fetching
: null}