React-redux-firebase Firebase Storage Is Required to Upload Files
export part createNewGroup(mail service) { return (dispatch, getState, getFirebase) => { console.log(' in hither !!!!!!!!!!!!'); render getFirebase() .ref('posts') .button(post) .then(() => { dispatch(sendNotification('Todo Added')); }); }; } still non getting into the console.log part ...
I am getting into the office earlier the return role
Are you sure that createNewGroup in onSubmit is the prop that mapped with dispatch?
If your createNewGroup in onSubmit is the one from import argument and so it's but the same as before
ok I go you, so how do I know ? I have the mapDispatchToProps called in the connect function
Then I call it in the on submit
If it'southward from props you accept to access via props.createNewGroup
ok i'chiliad getting into the function at present
If you lot call only createNewGroup it volition just find whatever a variable with that proper noun which almost likely will be from your import statement
@illuminist - please explain why is my firebase casing and so bad :( ?
it is firestore non fireStore
oh - I thought you lot where talking about something in the function construction
This is a full general JS convention ?
The proper noun is Firestore so casing for variable proper noun will exist firestore
Howdy anybody :)
I'k trying to upload files using firebase.uploadFiles.
The files are correctly uploaded but an error go thrown:
TypeError: firebase.database is non a function Too, when trying to list the uploaded files
const uploadedFiles = useSelector( ({ firebase: { data } }) => information) uploadedFiles is empty.
Any thought why this would be happening ?
Information technology is very weird that the files are uploaded but an error is thrown anyway
@Antonhansel Later a file is uploaded, react-redux-firebase wants to write file metadata to firebase database. Which means if you haven't do `import 'firebase/database', the database feature will non exist in firebase scope, thus cannot phone call the function
Aaah, I see, I did crave firebase/storage thinking it was covering the database every bit well, I'thousand trying this right now
Hi I have this function that's trying to delete a document in a subcollection
const leaveGroup = groupId => { firestore .drove('users') .doc(user.uid) .collection('groups') .doc(groupId) .delete() .then( function() { console.log('deleted'); }) .catch( function(error) { panel.error('Mistake removing document: ', fault); }); }; in the .so() later on delete - I see the console "deleted" - just I however see the document in the collection on firestore, AND, the deleted doc is renders over again in the page.
When I press click on the delete push - I can run into it disappear and and then it comes back
And here is the strange matter I see in the logs:
LOG deleted LOG in useSelector LOG detail from Firestore znbjLoQd21PZmrwSE9yW LOG component - render LOG in useSelector LOG detail from Firestore znbjLoQd21PZmrwSE9yW LOG in useSelector LOG detail from Firestore znbjLoQd21PZmrwSE9yW LOG item from Firestore eO0XCK4Ab1ouYalJXktd LOG component - render LOG in useSelector LOG item from Firestore znbjLoQd21PZmrwSE9yW LOG item from Firestore eO0XCK4Ab1ouYalJXktd Subsequently the delete() - the useSelector is run twice with only one item (which is the right number of items afterward delete)
and then information technology runs ii more times with 2 items (which was the case before delete)
And I should also mention the the items come up from a subcollection
Howdy. I accept read concluding letters and fixed my result nigh contour ) thank you all.
I accept one more question. I store profile data in 'user' collection. What security permission I should set for that collection? When I fix write can only authenticated on registration new profiles not created. For at present I gear up write tin everyone, merely I'thou afraid that it'south not good.
@Aparus Highly depends on how you desire your user interact with database. You take to make up one's mind that by your own need.
But for a starter, user should only read and write their own user collection
on registration, on first profile creating, 'user' collection should be opened for everyone for write? I advise at that moment 'auth' land is empty?
The user is created on firebase auth earlier react-redux-firebase phone call to save profile on firestore and firebase login the user immediately after the user is created, which should make it passes the security rules, unless isn't getting login later creating an account
Hard to understand your terminal message ...
I tried now to fix
match /user/{doc} { allow create: if isAuthorized(); let update, read: if isOwner(); } It doesn't piece of work. Profile haven't been created. I meet only ane way, permit create: if truthful
no, I use 'user' drove for profile
Have you set rrf configs to write to that path?
yes. it works with other security rules. (allow create: if truthful;)
import firebase from './firebase' import shop from '../store/rootReducer' import { createFirestoreInstance } from 'redux-firestore' const rrfProps = { firebase, config: { userProfile: 'user', useFirestoreForProfile: true }, dispatch: store.dispatch, createFirestoreInstance } export { rrfProps } Source: https://gitter.im/redux-firebase/Lobby?at=5dd41782add5717a883915c8
0 Response to "React-redux-firebase Firebase Storage Is Required to Upload Files"
Post a Comment