diff --git a/web/projects/ui/src/app/services/marketplace.service.ts b/web/projects/ui/src/app/services/marketplace.service.ts index bc2dcc7ab..4c8ab98a6 100644 --- a/web/projects/ui/src/app/services/marketplace.service.ts +++ b/web/projects/ui/src/app/services/marketplace.service.ts @@ -42,7 +42,7 @@ export class MarketplaceService implements AbstractMarketplaceService { private readonly knownHosts$: Observable = this.patch .watch$('ui', 'marketplace', 'knownHosts') .pipe( - map(hosts => { + map((hosts: { [url: string]: UIStore }) => { const { start9, community } = this.config.marketplace let arr = [ toStoreIdentity(start9, hosts[start9]), @@ -81,31 +81,35 @@ export class MarketplaceService implements AbstractMarketplaceService { shareReplay({ bufferSize: 1, refCount: true }), ) - private readonly marketplace$ = this.knownHosts$.pipe( - startWith([]), - pairwise(), - mergeMap(([prev, curr]) => - curr.filter(c => !prev.find(p => sameUrl(c.url, p.url))), - ), - mergeMap(({ url, name }) => - this.fetchStore$(url).pipe( - tap(data => { - if (data?.info.name) this.updateStoreName(url, name, data.info.name) - }), - map(data => [url, data]), - startWith<[string, StoreData | null]>([url, null]), + private readonly marketplace$: Observable = + this.knownHosts$.pipe( + startWith([]), + pairwise(), + mergeMap(([prev, curr]) => + curr.filter(c => !prev.find(p => sameUrl(c.url, p.url))), ), - ), - scan<[string, StoreData | null], Record>( - (requests, [url, store]) => { - requests[url] = store + mergeMap(({ url, name }) => + this.fetchStore$(url).pipe( + tap(data => { + if (data?.info.name) this.updateStoreName(url, name, data.info.name) + }), + map(data => [ + url, + data, + ]), + startWith<[string, StoreData | null]>([url, null]), + ), + ), + scan<[string, StoreData | null], Record>( + (requests, [url, store]) => { + requests[url] = store - return requests - }, - {}, - ), - shareReplay({ bufferSize: 1, refCount: true }), - ) + return requests + }, + {}, + ), + shareReplay({ bufferSize: 1, refCount: true }), + ) private readonly filteredMarketplace$ = combineLatest([ this.clientStorageService.showDevTools$,