diff options
Diffstat (limited to 'src/actions/app.js')
-rw-r--r-- | src/actions/app.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/actions/app.js b/src/actions/app.js index aecefc4..31b51a4 100644 --- a/src/actions/app.js +++ b/src/actions/app.js @@ -30,7 +30,7 @@ import {snapshotForums} from './firebaseFirestore.js'; var isSubscribedForums = false; -const loadPage = (page) => (dispatch) => { +const loadPage = (page) => (dispatch, getState) => { switch(page) { case 'home': import('../components/mao-home.js'); @@ -57,7 +57,12 @@ const loadPage = (page) => (dispatch) => { break; case 'admin': - import('../components/mao-admin.js'); + if(getState().firebaseAdmin.isAdmin) { + import('../components/mao-admin.js'); + } else { + page = 'view404'; + import('../components/my-view404.js'); + } break; default: |