# Conflicts:
#	android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuth.java
This commit is contained in:
Salakar
2017-07-12 13:39:29 +01:00
86 changed files with 4305 additions and 537 deletions

View File

@@ -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(

View File

@@ -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;