fix errors in shared and marketplace

This commit is contained in:
Matt Hill
2023-07-11 12:53:42 -06:00
parent b9316a4112
commit 31811eb91e
8 changed files with 77 additions and 38 deletions

View File

@@ -1,8 +1,8 @@
import { HttpErrorResponse } from '@angular/common/http'
export class HttpError {
constructor(private readonly error: HttpErrorResponse) {}
readonly code = this.error.status
readonly message = this.error.statusText
constructor(private readonly error: HttpErrorResponse) {}
}

View File

@@ -1,11 +1,11 @@
import { RPCErrorDetails } from '../types/rpc.types'
export class RpcError {
constructor(private readonly error: RPCErrorDetails) {}
readonly code = this.error.code
readonly message = this.getMessage()
constructor(private readonly error: RPCErrorDetails) {}
private getMessage(): string {
let message: string

View File

@@ -46,13 +46,6 @@ export class ResponsiveColViewportDirective extends Observable<Step> {
@Input()
responsiveColViewport: Observable<Step> | '' = ''
private readonly stream$ = this.resize$.pipe(
map(() => this.elementRef.nativeElement.clientWidth),
map(width => this.breakpoints.find(([step]) => width >= step)?.[1] || 'xs'),
distinctUntilChanged(),
tuiZonefree(this.zone),
)
constructor(
@Inject(BREAKPOINTS)
private readonly breakpoints: readonly [number, Step][],
@@ -64,4 +57,11 @@ export class ResponsiveColViewportDirective extends Observable<Step> {
(this.responsiveColViewport || this.stream$).subscribe(subscriber),
)
}
private readonly stream$ = this.resize$.pipe(
map(() => this.elementRef.nativeElement.clientWidth),
map(width => this.breakpoints.find(([step]) => width >= step)?.[1] || 'xs'),
distinctUntilChanged(),
tuiZonefree(this.zone),
)
}