diff --git a/frontend/src/Metamaps/Router.js b/frontend/src/Metamaps/Router.js index 9ad80187..8bbd6949 100644 --- a/frontend/src/Metamaps/Router.js +++ b/frontend/src/Metamaps/Router.js @@ -59,6 +59,7 @@ const _Router = Backbone.Router.extend({ Views.ExploreMaps.setCollection(Metamaps.Maps.Active) if (Metamaps.Maps.Active.length === 0) { + Views.ExploreMaps.pending = true Metamaps.Maps.Active.getMaps(navigate) // this will trigger an explore maps render } else { Views.ExploreMaps.render(navigate) @@ -134,6 +135,7 @@ const _Router = Backbone.Router.extend({ } if (Metamaps.Maps[capitalize].length === 0) { Metamaps.Loading.show() + Views.ExploreMaps.pending = true setTimeout(function () { Metamaps.Maps[capitalize].getMaps(navigate) // this will trigger an explore maps render }, 300) // wait 300 milliseconds till the other animations are done to do the fetch diff --git a/frontend/src/components/Maps/index.js b/frontend/src/components/Maps/index.js index df59b446..fee6c332 100644 --- a/frontend/src/components/Maps/index.js +++ b/frontend/src/components/Maps/index.js @@ -41,7 +41,7 @@ class Maps extends Component { } render = () => { - const { maps, currentUser, juntoState, section, user, moreToLoad, loadMore, onStar, onRequest } = this.props + const { maps, currentUser, juntoState, pending, section, user, moreToLoad, loadMore, onStar, onRequest } = this.props const style = { width: this.state.mapsWidth + 'px' } return ( @@ -49,7 +49,7 @@ class Maps extends Component {
{ user ? : null } - { currentUser && !user ?
Create new map...
: null } + { currentUser && !user && !(pending && maps.length === 0) ?
Create new map...
: null } { maps.models.map(map => ) }