From 5c9bbeac92df8b0a61a6d0eda714d196b2d46d5c Mon Sep 17 00:00:00 2001 From: kurt Date: Wed, 2 Oct 2024 14:24:25 +0800 Subject: [PATCH] refactor powerup --- src/pages/resources/components/forms/powerup.svelte | 4 ++-- src/pages/resources/components/state/prices.svelte | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/resources/components/forms/powerup.svelte b/src/pages/resources/components/forms/powerup.svelte index f0d9953e..eeb2a3a4 100644 --- a/src/pages/resources/components/forms/powerup.svelte +++ b/src/pages/resources/components/forms/powerup.svelte @@ -9,7 +9,7 @@ import {activeBlockchain, activeSession, currentAccount} from '~/store' import {systemToken} from '~/stores/tokens' import {systemTokenBalance} from '~/stores/balances' - import {cpuPowerupPrice, netPowerupPrice, sampleUsage, statePowerUp} from '~/pages/resources/resources' + import {cpuPowerupPrice as powerupPrice, sampleUsage, statePowerUp} from '~/pages/resources/resources' import type {FormTransaction} from '~/ui-types' import Button from '~/components/elements/button.svelte' @@ -23,7 +23,7 @@ export let resource: string = 'cpu' const unit = resource === 'cpu' ? 'ms' : 'kb' - const powerupPrice = resource === 'cpu' ? cpuPowerupPrice : netPowerupPrice + // const powerupPrice = resource === 'cpu' ? cpuPowerupPrice : netPowerupPrice let amount: Writable = writable('') let error: string | undefined diff --git a/src/pages/resources/components/state/prices.svelte b/src/pages/resources/components/state/prices.svelte index 8263d7ff..7ea76b8e 100644 --- a/src/pages/resources/components/state/prices.svelte +++ b/src/pages/resources/components/state/prices.svelte @@ -5,7 +5,7 @@ import {ChainFeatures} from '~/config' import {activeBlockchain} from '~/store' - import {cpuPowerupPrice, netPowerupPrice, rexPrice, cpuStakingPrice, netStakingPrice} from '~/pages/resources/resources' + import {cpuPowerupPrice as powerupPrice, rexPrice, cpuStakingPrice as stakingPrice} from '~/pages/resources/resources' import Button from '~/components/elements/button.svelte' import Segment from '~/components/elements/segment.svelte' @@ -13,8 +13,8 @@ export let resource = 'cpu' const unit = resource === 'cpu' ? 'ms' : 'kb' - const powerupPrice = resource === 'cpu' ? cpuPowerupPrice : netPowerupPrice - const stakingPrice = resource === 'cpu' ? cpuStakingPrice : netStakingPrice + // const powerupPrice = resource === 'cpu' ? cpuPowerupPrice : netPowerupPrice + // const stakingPrice = resource === 'cpu' ? cpuStakingPrice : netStakingPrice const {PowerUp, REX, Staking} = ChainFeatures