diff --git a/app/src/app/pages/reservations/reservations.store.ts b/app/src/app/pages/reservations/reservations.store.ts index 6718a77..3fb03fd 100644 --- a/app/src/app/pages/reservations/reservations.store.ts +++ b/app/src/app/pages/reservations/reservations.store.ts @@ -1,5 +1,5 @@ import { ComponentStore, tapResponse } from '@ngrx/component-store'; -import { concatMap, EMPTY, Observable, of, switchMap } from 'rxjs'; +import { concatMap, EMPTY, Observable, of, switchMap, tap } from 'rxjs'; import { Injectable } from '@angular/core'; import { DeviceErrors } from '../../schemas/errors/device'; import { @@ -96,13 +96,13 @@ export class ReservationsComponentStore extends ComponentStore this.patchState({ isLoading: false })), tapResponse( (reservations) => { - this.patchState({ reservations, isLoading: false }); + this.patchState({ reservations }); onUpdate(reservations); }, () => { - this.patchState({ isLoading: false }); this.store.dispatch( minorError({ error: DeviceErrors.NOT_CONNECTED }), ); @@ -133,10 +133,10 @@ export class ReservationsComponentStore extends ComponentStore this.patchState({ isLoading: false })), tapResponse( (reservation) => this.onDeleteReservationResponse(reservation), () => { - this.patchState({ isLoading: false }); this.store.dispatch( minorError({ error: DeviceErrors.NOT_CONNECTED }), ); @@ -159,12 +159,10 @@ export class ReservationsComponentStore extends ComponentStore { - this.patchState({ isLoading: false }); this.store.dispatch(minorError({ error: err.error })); }); } @@ -202,6 +200,7 @@ export class ReservationsComponentStore extends ComponentStore this.patchState({ isLoading: false })), tapResponse( (reservations) => { match(reservations)