Skip to content

Commit

Permalink
also skip loading hal requests
Browse files Browse the repository at this point in the history
(cherry picked from commit c8ac260)
  • Loading branch information
artlowel authored and github-actions[bot] committed Jan 8, 2024
1 parent bd6c99d commit d109a5a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/core/shared/hal-endpoint.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { hasValue, isEmpty, isNotEmpty } from '../../shared/empty.util';
import { RESTURLCombiner } from '../url-combiner/rest-url-combiner';
import { Injectable } from '@angular/core';
import { EndpointMap } from '../cache/response.models';
import { getFirstCompletedRemoteData } from './operators';
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
import { RemoteData } from '../data/remote-data';
import { CacheableObject } from '../cache/cacheable-object.model';
Expand Down Expand Up @@ -37,8 +36,8 @@ export class HALEndpointService {
// This skip ensures that if a stale object is present in the cache when you do a
// call it isn't immediately returned, but we wait until the remote data for the new request
// is created.
skipWhile((rd: RemoteData<CacheableObject>) => rd.isStale),
getFirstCompletedRemoteData(),
skipWhile((rd: RemoteData<CacheableObject>) => rd.isLoading || rd.isStale),
take(1),
map((response: RemoteData<CacheableObject>) => {
if (hasValue(response.payload)) {
return response.payload._links;
Expand Down

0 comments on commit d109a5a

Please sign in to comment.