Skip to content

Commit a0953ae

Browse files
ayimsupermadu7
andauthored
[upstream vendurehq#5002] fix(admin-ui): fix missing currency button on initial load (vendurehq#4140) (#6)
Co-authored-by: Ifeanyi Madu <supermadu7@gmail.com>
1 parent c77bc8c commit a0953ae

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/admin-ui/src/lib/catalog/src/components/product-variant-detail/product-variant-detail.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
mergeMap,
3232
shareReplay,
3333
skip,
34+
startWith,
3435
switchMap,
3536
switchMapTo,
3637
take,
@@ -138,7 +139,10 @@ export class ProductVariantDetailComponent
138139
tap(data => (this.channelDefaultCurrencyCode = data.activeChannel.defaultCurrencyCode)),
139140
map(data => data.activeChannel.availableCurrencyCodes),
140141
);
141-
this.unusedCurrencyCodes$ = combineLatest(this.pricesForm.valueChanges, availableCurrencyCodes$).pipe(
142+
this.unusedCurrencyCodes$ = combineLatest([
143+
this.pricesForm.valueChanges.pipe(startWith(this.pricesForm.value)),
144+
availableCurrencyCodes$
145+
]).pipe(
142146
map(([prices, currencyCodes]) =>
143147
currencyCodes.filter(code => !prices.map(p => p.currencyCode).includes(code)),
144148
),

0 commit comments

Comments
 (0)