NgOnDestroy not working if close multiple browser tabs at once

293 views Asked by At

This code is correct work if user close one or two tabs of browser

@HostListener('window:beforeunload')
  async ngOnDestroy() {
    if (this.myValueSub) {
        this.myValueSub.unsubscribe();
    }

    await this.authService.logout();
  }

But this code not work if user close multiple browser tabs at once (five tabs or more)

What is the problem?

Can't determine the cause of the problem

0

There are 0 answers