mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
[Fix] websocket connecting and patchDB connection monitoring (#1738)
* refactor how we handle rpc responses and patchdb connection monitoring * websockets only * remove unused global error handlers * chore: clear storage inside auth service * feat: convert all global toasts to declarative approach (#1754) * no more reference to serverID Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: waterplea <alexander@inkin.ru>
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { first } from 'rxjs/operators'
|
||||
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||
import { UIMarketplaceData } from 'src/app/services/patch-db/data-model'
|
||||
import { firstValueFrom } from 'rxjs'
|
||||
import { filter, firstValueFrom } from 'rxjs'
|
||||
|
||||
export function getMarketplace(
|
||||
patch: PatchDbService,
|
||||
): Promise<UIMarketplaceData> {
|
||||
return firstValueFrom(patch.watch$('ui', 'marketplace'))
|
||||
return firstValueFrom(patch.watch$('ui', 'marketplace').pipe(filter(Boolean)))
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { first } from 'rxjs/operators'
|
||||
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||
import { firstValueFrom } from 'rxjs'
|
||||
import { filter, firstValueFrom } from 'rxjs'
|
||||
|
||||
export function getPackage(
|
||||
patch: PatchDbService,
|
||||
@@ -13,5 +12,5 @@ export function getPackage(
|
||||
export function getAllPackages(
|
||||
patch: PatchDbService,
|
||||
): Promise<Record<string, PackageDataEntry>> {
|
||||
return firstValueFrom(patch.watch$('package-data'))
|
||||
return firstValueFrom(patch.watch$('package-data').pipe(filter(Boolean)))
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||
import { ServerInfo } from 'src/app/services/patch-db/data-model'
|
||||
import { firstValueFrom } from 'rxjs'
|
||||
import { filter, firstValueFrom } from 'rxjs'
|
||||
|
||||
export function getServerInfo(patch: PatchDbService): Promise<ServerInfo> {
|
||||
return firstValueFrom(patch.watch$('server-info'))
|
||||
return firstValueFrom(patch.watch$('server-info').pipe(filter(Boolean)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user