Skip to content

Commit

Permalink
web: close shared service on window close
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed May 9, 2024
1 parent 714ac2d commit cb27039
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/web/src/common/sqlite/shared-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ export class SharedService<T extends object> extends EventTarget {
{ signal: this.#onClose.signal }
);

window.addEventListener("beforeunload", () => {
this.close();
});

this.proxy = this.#createProxy();
}

Expand Down

0 comments on commit cb27039

Please sign in to comment.