Skip to content

Commit efdf7fe

Browse files
committed
Correctly send database_error event
1 parent 4af0b53 commit efdf7fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ios/Firestack/FirestackDatabase.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ @implementation FirestackDatabase
358358
NSDictionary *props =
359359
[self snapshotToDict:snapshot];
360360
[self
361-
sendJSEvent:eventName
361+
sendJSEvent:DATABASE_DATA_EVENT
362+
title:eventName
362363
props: @{
363364
@"eventName": eventName,
364365
@"path": path,
@@ -676,6 +677,7 @@ - (NSDictionary *) getAndSendDatabaseError:(NSError *) error
676677
};
677678
[self
678679
sendJSEvent:DATABASE_ERROR_EVENT
680+
title:DATABASE_ERROR_EVENT
679681
props: evt];
680682

681683
return evt;
@@ -686,11 +688,12 @@ - (NSDictionary *) getAndSendDatabaseError:(NSError *) error
686688
return @[DATABASE_DATA_EVENT, DATABASE_ERROR_EVENT];
687689
}
688690

689-
- (void) sendJSEvent:(NSString *)title
691+
- (void) sendJSEvent:(NSString *)type
692+
title:(NSString *)title
690693
props:(NSDictionary *)props
691694
{
692695
@try {
693-
[self sendEventWithName:DATABASE_DATA_EVENT
696+
[self sendEventWithName:type
694697
body:@{
695698
@"eventName": title,
696699
@"body": props

0 commit comments

Comments
 (0)