[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:
Matt Hill
2022-08-22 10:53:52 -06:00
committed by GitHub
parent 70baed88f4
commit 3ddeb5fa94
101 changed files with 1177 additions and 1298 deletions

View File

@@ -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)))
}

View File

@@ -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)))
}

View File

@@ -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)))
}