Gabriel Guedes
Gabriel Guedes

Reputation: 491

ion-refresher bug in ionic

I have an ion-refresher in 5 pages of my application

  <ion-refresher slot="fixed" (ionRefresh)="refreshActions($event)">
    <ion-refresher-content pulling-icon="null" refreshing-spinner="null">
      <ion-spinner name="crescent"></ion-spinner>
    </ion-refresher-content>
  </ion-refresher>

when im pulling down this refresh, it calls this method

  refreshActions($event) {
    this.subscription$.forEach(subscription => subscription.unsubscribe());
    this.loadFavoritesAssets(this.userId);
    setTimeout(() => {
      $event.target.complete();
    }, 500);
  }

this method unsubscribe from all subscriptions and reload the HTTP Request to call the new information in database, this works well

but when i navigate to another page, and try to call the other ion-refresher, the refresher doenst pull and doenst refresh the page, it gets stucks by the other page refresher.

then i need to get back to the previous page and scroll the screen or make some move to "complete" the refresh, after that i can refresh the other page.

Anyone knows what is this ? I dont undestand this behavior, it has something with the http request refresh method ? I'm calling the complete() method in the wrong way ?

And when i refresh the page and navigate to another page quickly, this behavior always happen

Upvotes: 0

Views: 964

Answers (1)

Vicky Pal
Vicky Pal

Reputation: 99

just remove this line from your above code and check

this.subscription$.forEach(subscription => subscription.unsubscribe());

Upvotes: 0

Related Questions