Skip to content

Commit

Permalink
fix: code deletion when switching between multiple instances (#81)
Browse files Browse the repository at this point in the history
* fix: misplaced _zombie assignment

* fix: update package version

---------

Co-authored-by: Harshita-Kanal <harshita.kgv@gmail.com>
  • Loading branch information
MrSurana and Harshita-Kanal authored Jan 4, 2024
1 parent c5fa9a1 commit d52319f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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;

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

0 comments on commit d52319f

Please sign in to comment.