diff options
Diffstat (limited to 'src/actions')
| -rw-r--r-- | src/actions/app.js | 9 | ||||
| -rw-r--r-- | src/actions/firebaseAdmin.js | 6 | ||||
| -rw-r--r-- | src/actions/firebaseFirestore.js | 6 | ||||
| -rw-r--r-- | src/actions/firebaseStorage.js | 6 |
4 files changed, 11 insertions, 16 deletions
diff --git a/src/actions/app.js b/src/actions/app.js index 422c52d..ef3f18e 100644 --- a/src/actions/app.js +++ b/src/actions/app.js @@ -29,7 +29,7 @@ export const navigate = (path) => (dispatch) => { import { snapshotForums } from './firebaseFirestore.js'; var hasSubscribedPosts = false; -const loadPage = (page) => (dispatch, getState) => { +const loadPage = (page) => (dispatch) => { switch(page) { case 'home': import('../components/mao-home.js'); @@ -57,12 +57,7 @@ const loadPage = (page) => (dispatch, getState) => { break; case 'admin': - if(getState().firebaseAdmin.isAdmin) { - import('../components/mao-admin.js'); - } else { - page = 'view404'; - import('../components/my-view404.js'); - } + import('../components/mao-admin.js'); break; default: diff --git a/src/actions/firebaseAdmin.js b/src/actions/firebaseAdmin.js index 5ca0d17..c322f64 100644 --- a/src/actions/firebaseAdmin.js +++ b/src/actions/firebaseAdmin.js @@ -1,4 +1,4 @@ -import { firestore, storage } from '../firebase.js'; +import { firestore, fireStorage } from '../firebase.js'; export const UPDATE_ADMIN = 'UPDATE_ADMIN'; export const UPDATE_ADMIN_REQUESTS = 'UPDATE_ADMIN_REQUESTS'; @@ -76,8 +76,8 @@ export const adminRejectHours = (_id, _path) => (dispatch) => { export const adminDeleteRequest = (_id, _path) => (dispatch) => { var docRef = firestore.collection('requests').doc(_id); docRef.delete().then(() => { - var storageRef = storage.ref().child(_path); - storageRef.delete().then(() => { + var fireStorageRef = fireStorage.ref().child(_path); + fireStorageRef.delete().then(() => { }); }); } diff --git a/src/actions/firebaseFirestore.js b/src/actions/firebaseFirestore.js index a95e0c8..7e65eec 100644 --- a/src/actions/firebaseFirestore.js +++ b/src/actions/firebaseFirestore.js @@ -1,4 +1,4 @@ -import { firestore, storage } from '../firebase.js'; +import { firestore, fireStorage } from '../firebase.js'; export const UPDATE_DIVISON = 'UPDATE_DIVISON'; export const UPDATE_HOURS = 'UPDATE_HOURS'; @@ -106,8 +106,8 @@ export const requestHours = (_time, _trainee, _location, _subject, _date, _pictu const _email = getState().firebaseAuth.userEmail; const _path = 'requests/' + _uid + '/' + _pictureName; - var storageRef = storage.ref().child(_path); - storageRef.getDownloadURL().then((url) => { + var fireStorageRef = fireStorage.ref().child(_path); + fireStorageRef.getDownloadURL().then((url) => { docRef.add({ time: _time, trainee: _trainee, diff --git a/src/actions/firebaseStorage.js b/src/actions/firebaseStorage.js index af114f1..6828344 100644 --- a/src/actions/firebaseStorage.js +++ b/src/actions/firebaseStorage.js @@ -1,12 +1,12 @@ -import { storage } from '../firebase.js'; +import { fireStorage } from '../firebase.js'; export const UPDATE_PICTURE = 'UPDATE_PICTURE'; export const uploadPicture = (file, uploader) => (dispatch, getState) => { if(file) { - var storageRef = storage.ref('requests/' + getState().firebaseAuth.uid + '/' + file.name); + var fireStorageRef = fireStorage.ref('requests/' + getState().firebaseAuth.uid + '/' + file.name); - var task = storageRef.put(file); + var task = fireStorageRef.put(file); task.on('state_changed', function(snapshot) { var percentage = (snapshot.bytesTransferred / |
