mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Refined portal preview amount values when switching discount type
no refs
This commit is contained in:
parent
161c53ca38
commit
c366eaa5ba
1 changed files with 3 additions and 2 deletions
|
@ -291,11 +291,12 @@ export default class OffersController extends Controller {
|
|||
@action
|
||||
setDiscountType(discountType) {
|
||||
if (!this.isDiscountSectionDisabled) {
|
||||
const amount = this.offer.amount || 0;
|
||||
this._saveOfferProperty('type', discountType);
|
||||
if (this.offer.type === 'fixed' && this.offer.amount !== '') {
|
||||
this.offer.amount = this.offer.amount * 100;
|
||||
this.offer.amount = amount * 100;
|
||||
} else if (this.offer.amount !== '') {
|
||||
this.offer.amount = this.offer.amount / 100;
|
||||
this.offer.amount = amount / 100;
|
||||
}
|
||||
this.updatePortalPreview({forceRefresh: false});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue