Skip to content

Commit eb7d422

Browse files
authored
Merge pull request #2037 from oasisprotocol/lw/fix-production
Fix detecting production env (fix exhausted type error in production)
2 parents 0adc777 + fa4d606 commit eb7d422

File tree

12 files changed

+381
-371
lines changed

12 files changed

+381
-371
lines changed

.changelog/2037.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix exhausted type error in production (should be a console warning)

src/app/components/RuntimeTransactionMethod/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ const getRuntimeTransactionLabel = (t: TFunction, method: KnownRuntimeTxMethod)
5050
return t('transactions.method.roflmarket.providerCreate')
5151
case 'roflmarket.ProviderUpdate':
5252
return t('transactions.method.roflmarket.providerUpdate')
53+
case 'roflmarket.ProviderUpdateOffers':
54+
return t('transactions.method.roflmarket.providerUpdateOffers')
5355
case 'roflmarket.ProviderRemove':
5456
return t('transactions.method.roflmarket.providerRemove')
5557
case 'roflmarket.InstanceCreate':
@@ -80,6 +82,7 @@ const knownRuntimeTxMethods = [
8082
'rofl.Update',
8183
'roflmarket.ProviderCreate',
8284
'roflmarket.ProviderUpdate',
85+
'roflmarket.ProviderUpdateOffers',
8386
'roflmarket.ProviderRemove',
8487
'roflmarket.InstanceCreate',
8588
'roflmarket.InstanceTopUp',
@@ -132,6 +135,7 @@ export const getRuntimeRoflUpdatesMethodOptions = (t: TFunction): SelectOptionBa
132135
* - "rofl.Register"
133136
* - "roflmarket.ProviderCreate"
134137
* - "roflmarket.ProviderUpdate"
138+
* - "roflmarket.ProviderUpdateOffers"
135139
* - "roflmarket.ProviderRemove"
136140
* - "roflmarket.InstanceCreate"
137141
* - "roflmarket.InstanceTopUp"
@@ -172,6 +176,8 @@ const getRuntimeTransactionIcon = (method: KnownRuntimeTxMethod, label: string,
172176
return <MethodIcon color="green" icon={<DeveloperBoard />} {...props} />
173177
case 'roflmarket.ProviderUpdate':
174178
return <MethodIcon color="green" icon={<DeveloperBoard />} {...props} />
179+
case 'roflmarket.ProviderUpdateOffers':
180+
return <MethodIcon color="green" icon={<DeveloperBoard />} {...props} />
175181
case 'roflmarket.ProviderRemove':
176182
return <MethodIcon color="orange" icon={<DeveloperBoardOffIcon />} {...props} />
177183
case 'roflmarket.InstanceCreate':

src/app/pages/ConsensusAccountDetailsPage/Staking.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { useRequiredScopeParam } from '../../../app/hooks/useScopeParam'
1717
import { AppErrors } from '../../../types/errors'
1818
import { NUMBER_OF_ITEMS_ON_DASHBOARD as PAGE_SIZE } from '../../../config'
1919
import { useSearchParamsPagination } from '../../components/Table/useSearchParamsPagination'
20-
import { Delegations } from '../..//components/Delegations'
20+
import { Delegations } from '../../components/Delegations'
2121
import { wallet } from '../../utils/externalLinks'
2222
import { t } from 'i18next'
2323
import { ConsensusAccountCardEmptyState } from './ConsensusAccountCardEmptyState'

src/app/pages/ConsensusBlockDetailPage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Block, EntityMetadata, useGetConsensusBlockByHeight } from '../../../oa
88
import { ConsensusScope } from '../../../types/searchScope'
99
import { useFormattedTimestampStringWithDistance } from '../../hooks/useFormattedTimestamp'
1010
import { useConsensusScope } from '../../hooks/useScopeParam'
11-
import { RouterTabs } from '../..//components/RouterTabs'
11+
import { RouterTabs } from '../../components/RouterTabs'
1212
import { StyledDescriptionList } from '../../components/StyledDescriptionList'
1313
import { CopyToClipboard } from '../../components/CopyToClipboard'
1414
import { TextSkeleton } from '../../components/Skeleton'

src/app/pages/RoflAppDetailsPage/RoflAppUpdatesCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { updatesContainerId } from '../../utils/tabAnchors'
77
import { LinkableCardLayout } from '../../components/LinkableCardLayout'
88
import { RuntimeTransactions } from '../../components/Transactions'
99
import { RuntimeTransactionTypeFilter } from '../../components/Transactions/RuntimeTransactionTypeFilter'
10-
import { getRuntimeRoflUpdatesMethodOptions } from '../..//components/RuntimeTransactionMethod'
10+
import { getRuntimeRoflUpdatesMethodOptions } from '../../components/RuntimeTransactionMethod'
1111
import { RoflAppDetailsContext, useRoflAppUpdates } from './hooks'
1212

1313
export const RoflAppUpdatesCard: FC<RoflAppDetailsContext> = context => {

src/app/pages/RoflAppInstanceDetailsPage/hooks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AppErrors } from '../../../types/errors'
44
import { RuntimeScope } from '../../../types/searchScope'
55
import { NUMBER_OF_ITEMS_ON_SEPARATE_PAGE as limit, paraTimesConfig } from '../../../config'
66
import { getRuntimeTransactionMethodFilteringParam } from '../../components/RuntimeTransactionMethod'
7-
import { useSearchParamsPagination } from '../..//components/Table/useSearchParamsPagination'
7+
import { useSearchParamsPagination } from '../../components/Table/useSearchParamsPagination'
88

99
export type RoflAppInstanceDetailsContext = {
1010
scope: RuntimeScope

src/app/utils/transaction.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const isRoflTransaction = (method: string | undefined): boolean => {
4040
'rofl.Register',
4141
'roflmarket.ProviderCreate',
4242
'roflmarket.ProviderUpdate',
43+
'roflmarket.ProviderUpdateOffers',
4344
'roflmarket.ProviderRemove',
4445
'roflmarket.InstanceCreate',
4546
'roflmarket.InstanceTopUp',

src/locales/en/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@
502502
"roflmarket": {
503503
"providerCreate": "ROFL Market Provider Create",
504504
"providerUpdate": "ROFL Market Provider Update",
505+
"providerUpdateOffers": "ROFL Market Provider Update Offers",
505506
"providerRemove": "ROFL Market Provider Remove",
506507
"machineCreate": "ROFL Market Machine Create",
507508
"machineTopUp": "ROFL Market Machine Top Up",

src/locales/getPreciseNumberFormat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function getPreciseNumberFormat(value: string) {
1212
const isFloatPrecise = new BigNumber(value).isEqualTo(parseFloat(value))
1313
// Fallback if types are not strict enough to prevent value=undefined and ''
1414
if (value == null || value === '' || decimalPlaces == null) {
15-
if (import.meta.env.NODE_ENV !== 'production') {
15+
if (!import.meta.env.PROD) {
1616
throw new Error(`Not a number in getNumberFormat(${value})`)
1717
}
1818
// Note: changing this to { value: '-' } would still display "NaN"

0 commit comments

Comments
 (0)