mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
follow sideload progress (#2718)
* follow sideload progress * small bugfix * shareReplay with no refcount false * don't wrap sideload progress in RPCResult * dont present toast --------- Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
@@ -81,9 +81,8 @@ export class MockApiService extends ApiService {
|
||||
.subscribe()
|
||||
}
|
||||
|
||||
async uploadPackage(guid: string, body: Blob): Promise<string> {
|
||||
async uploadPackage(guid: string, body: Blob): Promise<void> {
|
||||
await pauseFor(2000)
|
||||
return 'success'
|
||||
}
|
||||
|
||||
async getStaticProxy(
|
||||
@@ -106,7 +105,7 @@ export class MockApiService extends ApiService {
|
||||
|
||||
openWebsocket$<T>(
|
||||
guid: string,
|
||||
config: RR.WebsocketConfig<T>,
|
||||
config: RR.WebsocketConfig<T> = {},
|
||||
): Observable<T> {
|
||||
if (guid === 'db-guid') {
|
||||
return this.mockWsSource$.pipe<any>(
|
||||
@@ -125,6 +124,11 @@ export class MockApiService extends ApiService {
|
||||
return from(this.initProgress()).pipe(
|
||||
startWith(PROGRESS),
|
||||
) as Observable<T>
|
||||
} else if (guid === 'sideload-progress-guid') {
|
||||
config.openObserver?.next(new Event(''))
|
||||
return from(this.initProgress()).pipe(
|
||||
startWith(PROGRESS),
|
||||
) as Observable<T>
|
||||
} else {
|
||||
throw new Error('invalid guid type')
|
||||
}
|
||||
@@ -1079,8 +1083,8 @@ export class MockApiService extends ApiService {
|
||||
async sideloadPackage(): Promise<RR.SideloadPackageRes> {
|
||||
await pauseFor(2000)
|
||||
return {
|
||||
upload: '4120e092-05ab-4de2-9fbd-c3f1f4b1df9e', // no significance, randomly generated
|
||||
progress: '5120e092-05ab-4de2-9fbd-c3f1f4b1df9e', // no significance, randomly generated
|
||||
upload: 'sideload-upload-guid', // no significance, randomly generated
|
||||
progress: 'sideload-progress-guid', // no significance, randomly generated
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user