mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-24 04:24:52 +08:00
Merge branch 'master' of https://github.com/invertase/react-native-firebase into multi-apps
# Conflicts: # android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuth.java
This commit is contained in:
@@ -257,6 +257,7 @@ export default class Reference extends ReferenceBase {
|
||||
if (_failureCallback) {
|
||||
_failureCallback = (error) => {
|
||||
if (error.message.startsWith('FirebaseError: permission_denied')) {
|
||||
// eslint-disable-next-line
|
||||
error.message = `permission_denied at /${this.path}: Client doesn't have permission to access the desired data.`
|
||||
}
|
||||
|
||||
@@ -289,7 +290,7 @@ export default class Reference extends ReferenceBase {
|
||||
* @param eventName
|
||||
* @param successCallback
|
||||
* @param failureCallback
|
||||
* @param context TODO
|
||||
* TODO @param context
|
||||
* @returns {Promise.<TResult>}
|
||||
*/
|
||||
once(eventName: string = 'value', successCallback: (snapshot: Object) => void, failureCallback: (error: FirebaseError) => void) {
|
||||
@@ -328,7 +329,7 @@ export default class Reference extends ReferenceBase {
|
||||
*
|
||||
* @param {('value'|'child_added'|'child_changed'|'child_removed'|'child_moved')=} eventType - Type of event to detach callback for.
|
||||
* @param {Function=} originalCallback - Original callback passed to on()
|
||||
* @param {*=} context - The context passed to on() when the callback was bound
|
||||
* TODO @param {*=} context - The context passed to on() when the callback was bound
|
||||
*
|
||||
* {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#off}
|
||||
*/
|
||||
@@ -368,6 +369,7 @@ export default class Reference extends ReferenceBase {
|
||||
* @param onComplete
|
||||
* @param applyLocally
|
||||
*/
|
||||
|
||||
transaction(transactionUpdate: Function, onComplete: (error: ?Error, committed: boolean, snapshot: ?Snapshot) => *, applyLocally: boolean = false) {
|
||||
if (!isFunction(transactionUpdate)) {
|
||||
return Promise.reject(
|
||||
|
||||
@@ -17,9 +17,14 @@ export default class Snapshot {
|
||||
_childKeys: Array<string>;
|
||||
|
||||
constructor(ref: Reference, snapshot: Object) {
|
||||
this.ref = ref;
|
||||
this.key = snapshot.key;
|
||||
|
||||
if (ref.key !== snapshot.key) {
|
||||
this.ref = ref.child(snapshot.key);
|
||||
} else {
|
||||
this.ref = ref;
|
||||
}
|
||||
|
||||
// internal use only
|
||||
this._value = snapshot.value;
|
||||
this._priority = snapshot.priority === undefined ? null : snapshot.priority;
|
||||
|
||||
Reference in New Issue
Block a user