diff --git a/Makefile b/Makefile index 785f827d76..40bfdb723d 100644 --- a/Makefile +++ b/Makefile @@ -71,4 +71,4 @@ patch-db/client/dist: $(PATCH_DB_CLIENT_SRC) patch-db/client/node_modules npm --prefix patch-db/client run build # this is a convenience step to build all frontends - it is not referenced elsewhere in this file -frontend: frontend/node_modules $(EMBASSY_UIS) +frontend: frontend/node_modules frontend/config.json $(EMBASSY_UIS) diff --git a/frontend/projects/ui/src/app/services/api/api.fixures.ts b/frontend/projects/ui/src/app/services/api/api.fixures.ts index 6c0327747d..486fdba77b 100644 --- a/frontend/projects/ui/src/app/services/api/api.fixures.ts +++ b/frontend/projects/ui/src/app/services/api/api.fixures.ts @@ -610,7 +610,7 @@ export module Mock { } } = { bitcoind: { - '0.19.2': { + '0.19.0': { icon: BTC_ICON, license: 'licenseUrl', instructions: 'instructionsUrl', diff --git a/frontend/projects/ui/src/app/services/api/api.types.ts b/frontend/projects/ui/src/app/services/api/api.types.ts index 2f716e3f58..284325d2c0 100644 --- a/frontend/projects/ui/src/app/services/api/api.types.ts +++ b/frontend/projects/ui/src/app/services/api/api.types.ts @@ -472,3 +472,18 @@ export interface AvailableWifi { strength: number security: string[] } + +declare global { + type Stringified = string & { + [P in keyof T]: T[P] + } + + interface JSON { + stringify( + value: T, + replacer?: (key: string, value: any) => any, + space?: string | number, + ): string & Stringified + parse(text: Stringified, reviver?: (key: any, value: any) => any): T + } +} diff --git a/frontend/projects/ui/src/app/services/marketplace.service.ts b/frontend/projects/ui/src/app/services/marketplace.service.ts index 42646770dc..43225273ea 100644 --- a/frontend/projects/ui/src/app/services/marketplace.service.ts +++ b/frontend/projects/ui/src/app/services/marketplace.service.ts @@ -19,6 +19,7 @@ import { shareReplay, startWith, switchMap, + take, tap, } from 'rxjs/operators' @@ -45,6 +46,7 @@ export class MarketplaceService extends AbstractMarketplaceService { ) private readonly pkg$: Observable = this.init$.pipe( + take(1), switchMap(({ url, name }) => from(this.getMarketplacePkgs({ page: 1, 'per-page': 100 }, url)).pipe( tap(() => this.onPackages(name)), @@ -80,6 +82,7 @@ export class MarketplaceService extends AbstractMarketplaceService { getPackage(id: string, version: string): Observable { const params = { ids: [{ id, version }] } const fallback$ = this.init$.pipe( + take(1), switchMap(({ url }) => from(this.getMarketplacePkgs(params, url))), map(pkgs => this.findPackage(pkgs, id, version)), startWith(null), @@ -135,6 +138,7 @@ export class MarketplaceService extends AbstractMarketplaceService { req: Omit, ): Observable { return this.getMarketplace().pipe( + take(1), switchMap(({ url }) => from( this.api.installPackage({ @@ -172,7 +176,7 @@ export class MarketplaceService extends AbstractMarketplaceService { url: string, ): Promise { if (params.query) delete params.category - if (params.ids) params.ids = JSON.stringify(params.ids) as any + if (params.ids) params.ids = JSON.stringify(params.ids) const qp: RR.GetMarketplacePackagesReq = { ...params,