Bugfix/marketplace add (#1805)

* remove falsey check when getting marketplaces, as no alts could exist

* filter boolean but start with object

Co-authored-by: Matt Hill <matthewonthemoon@gmail.com>
This commit is contained in:
Lucy C
2022-09-15 13:30:49 -06:00
committed by GitHub
parent e326c5be4a
commit 53463077df
2 changed files with 18 additions and 5 deletions

View File

@@ -3,10 +3,18 @@ import {
DataModel,
UIMarketplaceData,
} from 'src/app/services/patch-db/data-model'
import { filter, firstValueFrom } from 'rxjs'
import { filter, firstValueFrom, startWith } from 'rxjs'
export function getMarketplace(
patch: PatchDB<DataModel>,
): Promise<UIMarketplaceData> {
return firstValueFrom(patch.watch$('ui', 'marketplace').pipe(filter(Boolean)))
return firstValueFrom(
patch.watch$('ui', 'marketplace').pipe(
filter(Boolean),
startWith({
'selected-id': null,
'known-hosts': {},
}),
),
)
}