mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
fix mrketplace swtiching (#1810)
This commit is contained in:
@@ -3,18 +3,20 @@ import {
|
||||
DataModel,
|
||||
UIMarketplaceData,
|
||||
} from 'src/app/services/patch-db/data-model'
|
||||
import { filter, firstValueFrom, startWith } from 'rxjs'
|
||||
import { firstValueFrom, map } from 'rxjs'
|
||||
|
||||
export function getMarketplace(
|
||||
patch: PatchDB<DataModel>,
|
||||
): Promise<UIMarketplaceData> {
|
||||
return firstValueFrom(
|
||||
patch.watch$('ui', 'marketplace').pipe(
|
||||
filter(Boolean),
|
||||
startWith({
|
||||
'selected-id': null,
|
||||
'known-hosts': {},
|
||||
}),
|
||||
map(
|
||||
m =>
|
||||
m || {
|
||||
'selected-id': null,
|
||||
'known-hosts': {},
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { filter, firstValueFrom } from 'rxjs'
|
||||
export function getPackage(
|
||||
patch: PatchDB<DataModel>,
|
||||
id: string,
|
||||
): Promise<PackageDataEntry> {
|
||||
): Promise<PackageDataEntry | undefined> {
|
||||
return firstValueFrom(patch.watch$('package-data', id))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user