Skip to content

Commit

Permalink
Merge pull request #1695 from IntersectMBO/fix/wrong-network-info-on-…
Browse files Browse the repository at this point in the history
…wallet-connect-modal

fix: fix displaying wrong network
  • Loading branch information
MSzalowski authored Aug 7, 2024
2 parents 4056b1b + 656f9aa commit 6d18f40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ changes.
- Incorrect copy on DRep votes + other minor copy spelling mistakes
- Remove incorrect @value property to fix validating the metadata body [Issue 1687](https://github.com/IntersectMBO/govtool/issues/1687)
- Fix PDF not enabled in default deployments
- Fix displaying incorrect connected to Voltaire GovTool network

### Changed

Expand Down
12 changes: 4 additions & 8 deletions govtool/frontend/src/context/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { Link } from "@mui/material";
import * as Sentry from "@sentry/react";
import { Trans } from "react-i18next";

import { PATHS, NETWORK_NAMES } from "@consts";
import { PATHS } from "@consts";
import { CardanoApiWallet, Protocol, VoterInfo } from "@models";
import type { StatusModalState } from "@organisms";
import {
Expand All @@ -64,11 +64,11 @@ import {
WALLET_LS_KEY,
} from "@utils";
import { getEpochParams } from "@services";
import { useGetNetworkMetrics, useTranslation } from "@hooks";
import { useTranslation } from "@hooks";
import { AutomatedVotingOptionDelegationId } from "@/types/automatedVotingOptions";

import { getUtxos } from "./getUtxos";
import { useModal, useSnackbar } from ".";
import { useAppContext, useModal, useSnackbar } from ".";
import {
PendingTransaction,
TransactionStateWithResource,
Expand Down Expand Up @@ -941,11 +941,7 @@ const CardanoProvider = (props: Props) => {
};

function useCardano() {
const { networkMetrics } = useGetNetworkMetrics();
const networkName =
NETWORK_NAMES[
(networkMetrics?.networkName as keyof typeof NETWORK_NAMES) || "preview"
];
const { networkName } = useAppContext();

const context = useContext(CardanoContext);
const { openModal, closeModal } = useModal<StatusModalState>();
Expand Down

0 comments on commit 6d18f40

Please sign in to comment.