Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: code deletion when switching between multiple instances #81

Merged
merged 15 commits into from
Jan 4, 2024
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hackerrank/firepad",
"description": "Collaborative text editing powered by Firebase",
"version": "0.8.4-beta",
"version": "0.8.5",
"author": {
"email": "bprogyan@gmail.com",
"name": "Progyan Bhattacharya",
Expand Down
3 changes: 2 additions & 1 deletion src/firebase-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ export class FirebaseAdapter implements IDatabaseAdapter {
}

dispose(): void {
this._zombie = true;
MrSurana marked this conversation as resolved.
Show resolved Hide resolved

if (!this._ready) {
this.on(FirebaseAdapterEvent.Ready, () => {
this.dispose();
Expand All @@ -197,7 +199,6 @@ export class FirebaseAdapter implements IDatabaseAdapter {
this._databaseRef = null;
this._userRef = null;
this._document = null;
this._zombie = true;
}

getDocument(): ITextOperation | null {
Expand Down
Loading