temporary fix to the reference off bug
This commit is contained in:
parent
60a9f879ff
commit
e4ae2609da
|
@ -416,12 +416,14 @@ public class RNFirebaseDatabase extends ReactContextBaseJavaModule {
|
|||
@ReactMethod
|
||||
public void off(String key, String eventRegistrationKey) {
|
||||
RNFirebaseDatabaseReference nativeRef = references.get(key);
|
||||
if (nativeRef) {
|
||||
nativeRef.removeEventListener(eventRegistrationKey);
|
||||
|
||||
if (!nativeRef.hasListeners()) {
|
||||
references.remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* INTERNALS/UTILS
|
||||
|
|
Loading…
Reference in New Issue