Skip to content

Commit 51f18e8

Browse files
committed
Fix breakage when path to declare ref.on() event handler differs from paths of snapshots returned by callback.
1 parent ee00012 commit 51f18e8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ios/Firestack/FirestackDatabase.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ - (void) addEventHandler:(NSString *) eventName
5959
@"eventName": eventName,
6060
@"path": [self absPath:[snapshot ref]],
6161
@"modifiersString": _modifiersString,
62-
@"snapshot": props
62+
@"snapshot": props,
63+
@"handlePath": _path
6364
}];
6465
};
6566
id errorBlock = ^(NSError * _Nonnull error) {

lib/modules/database/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ export default class Database extends Base {
179179
*/
180180
_handleDatabaseEvent(event: Object) {
181181
const body = event.body || {};
182-
const { path, modifiersString, eventName, snapshot } = body;
183-
const handle = this._handle(path, modifiersString);
182+
const { path, modifiersString, eventName, snapshot, handlePath } = body;
183+
const handle = this._handle(handlePath, modifiersString);
184184

185185
this.log.debug('_handleDatabaseEvent: ', handle, eventName, snapshot && snapshot.key);
186186

0 commit comments

Comments
 (0)