diff options
| author | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-07-30 17:47:26 -0400 |
|---|---|---|
| committer | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-07-30 17:47:26 -0400 |
| commit | 9d96ac4ae65c9fe6f5df8b5a95028495f4b00c49 (patch) | |
| tree | e593ddae633606380a6fe45424bbaaaf0f2f80e1 /src/actions/app.js | |
| parent | 25b7ac9f323b366520781a6a75b381f635a1f9ff (diff) | |
Making big additions to backend and frontend development to fourm system.
Diffstat (limited to 'src/actions/app.js')
| -rw-r--r-- | src/actions/app.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/actions/app.js b/src/actions/app.js index 3a5f9fb..fce37d7 100644 --- a/src/actions/app.js +++ b/src/actions/app.js @@ -26,6 +26,9 @@ export const navigate = (path) => (dispatch) => { dispatch(updateDrawerState(false)); }; +import {snapshotFourms} from './firebase.js'; +var hasSubscribedPosts = false; + const loadPage = (page) => (dispatch) => { switch(page) { case 'home': @@ -41,7 +44,12 @@ const loadPage = (page) => (dispatch) => { import('../components/mao-tutoring.js'); break; case 'fourms': - import('../components/mao-fourms.js'); + import('../components/mao-fourms.js').then((module) => { + if(!hasSubscribedPosts) { + dispatch(snapshotFourms()); + hasSubscribedPosts = true; + } + });; break; case 'account': import('../components/mao-account.js'); |
