From 6aac572c752cda04c4e3e213df3f42fc29b3a11a Mon Sep 17 00:00:00 2001 From: alter-eggo Date: Fri, 30 Jun 2023 21:28:27 +0400 Subject: [PATCH] fixes after review --- .../cross-chain-boost/StakingCardSyncAlert.vue | 13 ++++++++----- src/locales/default.json | 2 +- src/providers/cross-chain-sync.provider.ts | 17 +++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/contextual/pages/vebal/cross-chain-boost/StakingCardSyncAlert.vue b/src/components/contextual/pages/vebal/cross-chain-boost/StakingCardSyncAlert.vue index 4163a37714..e8f699554b 100644 --- a/src/components/contextual/pages/vebal/cross-chain-boost/StakingCardSyncAlert.vue +++ b/src/components/contextual/pages/vebal/cross-chain-boost/StakingCardSyncAlert.vue @@ -7,6 +7,7 @@ import { import { usePoolStaking } from '@/providers/local/pool-staking.provider'; import CheckpointGaugeModal from './CheckpointGaugeModal.vue'; import useWeb3 from '@/services/web3/useWeb3'; +import config from '@/lib/config'; type Props = { fiatValueOfStakedShares: string; @@ -30,8 +31,9 @@ const tipText = computed(() => { if ( networksSyncState.value[networkId.value] === NetworkSyncState.Unsynced ) { - text = - 'After your veBAL syncs to [Arbitrum], restake to move from the deprecated pool gauge to the new boost-aware pool gauge. If you restake before the veBAL syncs, you’ll need to perform another interaction on the gauge to start receiving your staking boost.'; + text = `After your veBAL syncs to ${ + config[networkId.value].chainName + }, restake to move from the deprecated pool gauge to the new boost-aware pool gauge. If you restake before the veBAL syncs, you’ll need to perform another interaction on the gauge to start receiving your staking boost.`; } if (networksSyncState.value[networkId.value] === NetworkSyncState.Synced) { @@ -69,20 +71,21 @@ async function setWarningAlertState() { } try { + emit('shouldStakingCardBeOpened'); + const balance = await getGaugeWorkingBalance(id); // if the second number it returns is greater than the first, then show the message if (balance[1]?.gt(balance[0])) { shouldShowWarningAlert.value = true; - emit('shouldStakingCardBeOpened'); } } catch (error) { console.log(error); } } -onBeforeMount(() => { - void setWarningAlertState(); +onMounted(() => { + setWarningAlertState(); }); diff --git a/src/locales/default.json b/src/locales/default.json index ce209e1273..17381617a3 100644 --- a/src/locales/default.json +++ b/src/locales/default.json @@ -278,7 +278,7 @@ "syncNetworkAction": { "title": "This will sync your veBAL balance and give you a staking boost across the networks listed below." }, - "syncInProgress": "A sync operation is currently in progress. Wait until it completes before restaking any of your positions on [Arbitrum] to get your maximum veBAL boost." + "syncInProgress": "A sync operation is currently in progress. Wait until it completes before restaking any of your positions on {network} to get your maximum veBAL boost." }, "migratePool": { "aaveBoostedPool": { diff --git a/src/providers/cross-chain-sync.provider.ts b/src/providers/cross-chain-sync.provider.ts index 362b70ee4f..99f1ea6cae 100644 --- a/src/providers/cross-chain-sync.provider.ts +++ b/src/providers/cross-chain-sync.provider.ts @@ -293,14 +293,12 @@ export const crossChainSyncProvider = () => { const workingBalanceHelperContract = new GaugeWorkingBalanceHelper( contractAddress ); - const balances = - await workingBalanceHelperContract.getWorkingBalanceToSupplyRatios({ - signer, - userAddress: account.value, - gauge: gaugeAddress, - }); - return balances; + return workingBalanceHelperContract.getWorkingBalanceToSupplyRatios({ + signer, + userAddress: account.value, + gauge: gaugeAddress, + }); } // checkpoint @@ -308,12 +306,11 @@ export const crossChainSyncProvider = () => { const gaugeContract = new LiquidityGauge(gaugeAddress); const signer = getSigner(); - const tx = await gaugeContract.checkpointUser({ + + return gaugeContract.checkpointUser({ signer, userAddress: account.value, }); - - return tx; } watch(