Skip to content

Commit

Permalink
fix: render quoting pages properly
Browse files Browse the repository at this point in the history
* remove unnecassary timer operators from quote facades to make the PWA at least one time stable
  • Loading branch information
Eisie96 committed Feb 6, 2023
1 parent 0a2bf63 commit c1054ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
10 changes: 2 additions & 8 deletions src/app/extensions/quoting/facades/quote-context.facade.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable, OnDestroy } from '@angular/core';
import { Store, select } from '@ngrx/store';
import { RxState } from '@rx-angular/state';
import { Observable, timer } from 'rxjs';
import { Observable } from 'rxjs';
import { distinctUntilChanged, filter, first, map, sample, switchMap, tap } from 'rxjs/operators';

import { HttpError } from 'ish-core/models/http-error/http-error.model';
Expand Down Expand Up @@ -86,13 +86,7 @@ export abstract class QuoteContextFacade
this.connect('entityAsQuoteRequest', this.select('entity').pipe(map(QuotingHelper.asQuoteRequest)));
this.connect('entityAsQuote', this.select('entity').pipe(map(QuotingHelper.asQuote)));

this.connect(
'state',
timer(0, 2000).pipe(
switchMap(() => this.select('entity').pipe(map(QuotingHelper.state))),
distinctUntilChanged()
)
);
this.connect('state', this.select('entity').pipe(map(QuotingHelper.state), distinctUntilChanged()));

this.connect('editable', this.select('state').pipe(map(state => state === 'New')));
}
Expand Down
5 changes: 1 addition & 4 deletions src/app/extensions/quoting/facades/quoting.facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ export class QuotingFacade {
}

state$(quoteId: string) {
return timer(0, 2000).pipe(
switchMap(() => this.store.pipe(select(getQuotingEntity(quoteId)))),
map(QuotingHelper.state)
);
return this.store.pipe(select(getQuotingEntity(quoteId)), map(QuotingHelper.state));
}

name$(quoteId: string) {
Expand Down

0 comments on commit c1054ca

Please sign in to comment.