From 9b94ed9f6d107d1c027a729284bdb4c1b685a420 Mon Sep 17 00:00:00 2001 From: Moritz Kirstein Date: Tue, 31 Aug 2021 10:22:42 +0200 Subject: [PATCH] change initial price type based on config (#821) --- src/models/FormPricing.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/models/FormPricing.ts b/src/models/FormPricing.ts index c9ad3aac5..efe6785ca 100644 --- a/src/models/FormPricing.ts +++ b/src/models/FormPricing.ts @@ -1,4 +1,5 @@ import { PriceOptionsMarket } from '../@types/MetaData' +import { allowDynamicPricing, allowFixedPricing } from '../../app.config' import * as Yup from 'yup' export const validationSchema: Yup.SchemaOf = @@ -26,8 +27,13 @@ export const validationSchema: Yup.SchemaOf = export const initialValues: PriceOptionsMarket = { price: 1, - type: 'dynamic', - dtAmount: 9, + type: + allowDynamicPricing === 'true' + ? 'dynamic' + : allowFixedPricing === 'true' + ? 'fixed' + : 'free', + dtAmount: allowDynamicPricing === 'true' ? 9 : 1000, oceanAmount: 21, weightOnOcean: '7', // 70% on OCEAN weightOnDataToken: '3', // 30% on datatoken