Skip to content

Commit

Permalink
fix current label
Browse files Browse the repository at this point in the history
  • Loading branch information
ezra-sg committed Feb 14, 2024
1 parent 4324ff8 commit 09d0065
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/antelope/stores/rex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const useRexStore = defineStore(store_name, {
filter(({ label, account }) => !!label && !!account),
).subscribe({
next: async ({ label, account }) => {
if (label === 'current') {
if (label === CURRENT_CONTEXT) {
await useRexStore().updateRexDataForAccount(label, toRaw(account));
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/antelope/wallets/AntelopeWallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export class AntelopeWallets {
await jsonRpcProvider.ready;
const web3Provider = jsonRpcProvider as ethers.providers.Web3Provider;
return web3Provider;
} catch (e3) {
this.trace('getWeb3Provider authenticator.web3Provider() Failed!', e3);
} catch (e) {
this.trace('getWeb3Provider authenticator.web3Provider() Failed!', e);
throw new AntelopeError('antelope.evn.error_no_provider');
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/pages/evm/staking/StakingPageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { useRoute } from 'vue-router';
const route = useRoute();
const label = 'current';
const { t: $t } = useI18n();
const userStore = useUserStore();
const balancesStore = useBalancesStore();
Expand All @@ -29,7 +28,7 @@ const stakedToken = chainSettings.getStakedSystemToken();
// First cell: Staked
const unstakedRatio = computed(() => chainStore.getUnstakedRatio(label));
const unstakedRatio = computed(() => chainStore.getUnstakedRatio(CURRENT_CONTEXT));
const isStakedLoading = computed(() => stakedTokenBalanceBn.value === undefined || unstakedRatio.value.isZero());
const stakedExpressedInSystemBalanceBn = computed(() => {
if (stakedTokenBalanceBn.value && !unstakedRatio.value.isZero()) {
Expand Down
3 changes: 1 addition & 2 deletions src/pages/evm/staking/StakingTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import ConversionRateBadge from 'src/components/ConversionRateBadge.vue';
import CurrencyInput from 'src/components/evm/inputs/CurrencyInput.vue';
import { WEI_PRECISION, formatWei } from 'src/antelope/stores/utils';
const label = 'current';
const { t: $t } = useI18n();
const uiDecimals = 2;
Expand All @@ -43,7 +42,7 @@ const oneEth = ethers.BigNumber.from('1'.concat('0'.repeat(systemTokenDecimals))
const inputModelValue = ref(ethers.constants.Zero);
const estimatedGas = ref(ethers.constants.Zero);
// computed
const stakedRatio = computed(() => chainStore.getStakedRatio(label));
const stakedRatio = computed(() => chainStore.getStakedRatio(CURRENT_CONTEXT));
const outputModelValue = computed(() => {
if (stakedRatio.value.isZero()) {
return ethers.constants.Zero;
Expand Down
4 changes: 1 addition & 3 deletions src/pages/evm/staking/UnstakingTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import ConversionRateBadge from 'src/components/ConversionRateBadge.vue';
import CurrencyInput from 'src/components/evm/inputs/CurrencyInput.vue';
import { formatWei } from 'src/antelope/stores/utils';
const label = 'current';
const { t: $t } = useI18n();
const uiDecimals = 2;
const ant = getAntelope();
Expand All @@ -44,7 +42,7 @@ const oneEth = ethers.BigNumber.from('1'.concat('0'.repeat(systemTokenDecimals))
const inputModelValue = ref(ethers.constants.Zero);
// computed
const unstakedRatio = computed(() => chainStore.getUnstakedRatio(label));
const unstakedRatio = computed(() => chainStore.getUnstakedRatio(CURRENT_CONTEXT));
const outputModelValue = computed(() => {
if (unstakedRatio.value.isZero()) {
return ethers.constants.Zero;
Expand Down

0 comments on commit 09d0065

Please sign in to comment.