Skip to content

Commit

Permalink
fix(firestore): remove all listeners correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
robingenz committed Oct 30, 2023
1 parent b99f865 commit e6e75ad
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/mighty-planets-brush.md
@@ -0,0 +1,5 @@
---
'@capacitor-firebase/firestore': patch
---

fix: remove all listeners correctly
Expand Up @@ -452,7 +452,7 @@ public void removeAllListeners(PluginCall call) {
}

implementation.removeAllListeners();
call.resolve();
super.removeAllListeners(call);
} catch (Exception exception) {
Logger.error(TAG, exception.getMessage(), exception);
call.reject(exception.getMessage());
Expand Down
Expand Up @@ -290,6 +290,6 @@ public class FirebaseFirestorePlugin: CAPPlugin {
self.pluginCallMap.removeAll()

implementation?.removeAllListeners()
call.resolve()
super.removeAllListeners(call)
}
}
1 change: 1 addition & 0 deletions packages/firestore/src/web.ts
Expand Up @@ -232,6 +232,7 @@ export class FirebaseFirestoreWeb
public async removeAllListeners(): Promise<void> {
this.unsubscribesMap.forEach(unsubscribe => unsubscribe());
this.unsubscribesMap.clear();
await super.removeAllListeners();
}

private async buildCollectionQuery(
Expand Down

0 comments on commit e6e75ad

Please sign in to comment.