Skip to content

Commit

Permalink
fix(ios): event listener is not retained if was removed and added aga…
Browse files Browse the repository at this point in the history
…in (#2095)
  • Loading branch information
JohanVase authored and jcesarmobile committed Oct 24, 2019
1 parent 7bb4404 commit fb97d06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/CAPPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ - (void)notifyListeners:(NSString *)eventName data:(NSDictionary<NSString *,id>

- (void)notifyListeners:(NSString *)eventName data:(NSDictionary<NSString *,id> *)data retainUntilConsumed:(BOOL)retain {
NSArray<CAPPluginCall *> *listenersForEvent = [self.eventListeners objectForKey:eventName];
if(listenersForEvent == nil) {
if(listenersForEvent == nil || [listenersForEvent count] == 0) {
if (retain == YES) {
[self.retainedEventArguments setObject:data forKey:eventName];
}
Expand Down

0 comments on commit fb97d06

Please sign in to comment.