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

dropEventTimerSubscription: late unsubscription #260

Open
LeoNiedermeier opened this issue Apr 19, 2022 · 1 comment
Open

dropEventTimerSubscription: late unsubscription #260

LeoNiedermeier opened this issue Apr 19, 2022 · 1 comment

Comments

@LeoNiedermeier
Copy link

Related to #224

The dropEventTimerSubscription is not unsubscribed after dropped finished. It is still there and fires until the next drop event or the component is destroyed. This has the side effect that the angular change detection also runs every 200ms.

Maybe with a code like the following insteded of just using numOfActiveReadEntries--, the dropEventTimer in

this.dropEventTimerSubscription = timer(200, 200)
is not necessary anymore:

  decrementNumOfActiveReadEntries () {
    this.numOfActiveReadEntries --;

    if (this.numOfActiveReadEntries == 0) {
      this.zone.run(() =>
       const files = this.files;
        this.files = [];
        this.onFileDrop.emit(files);
    }
  }
@elruss
Copy link

elruss commented Apr 10, 2024

Is there a workaround for this? We use Angular's built-in testability object for QA, and the timer is preventing that object from stabilizing after a file drop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants