fix: fix build after minor merged into major

This commit is contained in:
waterplea
2024-08-15 12:40:49 +04:00
parent b43ad93c54
commit a730543c76
189 changed files with 714 additions and 3652 deletions

View File

@@ -1,7 +1,11 @@
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
import { toSignal } from '@angular/core/rxjs-interop'
import { Router } from '@angular/router'
import { ErrorService, InitializingComponent } from '@start9labs/shared'
import {
ErrorService,
formatProgress,
InitializingComponent,
} from '@start9labs/shared'
import { T } from '@start9labs/start-sdk'
import {
catchError,
@@ -40,9 +44,8 @@ export default class LoadingPage {
startWith(progress),
catchError((_, watch$) =>
interval(2000).pipe(
switchMap(() =>
from(this.api.getStatus()).pipe(catchError(() => EMPTY)),
),
switchMap(() => from(this.api.getStatus())),
catchError(() => EMPTY),
take(1),
switchMap(() => watch$),
),
@@ -54,13 +57,7 @@ export default class LoadingPage {
}),
),
),
map(({ phases, overall }) => ({
total: getDecimal(overall),
message: phases
.filter(p => p.progress !== true && p.progress !== null)
.map(p => `${p.name}${getPhaseBytes(p.progress)}`)
.join(','),
})),
map(formatProgress),
catchError(e => {
this.errorService.handleError(e)
return EMPTY
@@ -87,19 +84,3 @@ export default class LoadingPage {
}
}
}
function getDecimal(progress: T.Progress): number {
if (progress === true) {
return 1
} else if (!progress || !progress.total) {
return 0
} else {
return progress.total && progress.done / progress.total
}
}
function getPhaseBytes(progress: T.Progress): string {
return progress === true || !progress
? ''
: `: (${progress.done}/${progress.total})`
}