Skip to content

Commit

Permalink
fix navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzen1 authored and MSzalowski committed Jun 21, 2024
1 parent 781914d commit f185f8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const WalletInfoCard = () => {
await disconnectWallet();
navigate(
pathname.includes("/connected")
? `${pathname.replace("/connected", "")}${hash}`
? `${pathname.replace("/connected", "")}${hash ?? ""}`
: PATHS.home,
);
window.location.reload();
Expand Down
7 changes: 5 additions & 2 deletions govtool/frontend/src/components/molecules/WalletOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ export const WalletOptionButton: FC<WalletOption> = ({
const result = await enable(name);
if (result?.stakeKey) {
navigate(
pathToNavigate ?? pathname === "/"
// eslint-disable-next-line no-unneeded-ternary
pathToNavigate
? pathToNavigate
: pathname === "/"
? "/dashboard"
: `connected${pathname}${hash}`,
: `connected${pathname}${hash ?? ""}`,
{ state },
);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ export const GovernanceActionDetailsCardData = ({

const govActionLinkToShare = `${window.location.protocol}//${
window.location.hostname
}${window.location.port ? `:${window.location.port}` : ""}${pathname}${hash}`;
}${window.location.port ? `:${window.location.port}` : ""}${pathname}${
hash ?? ""
}`;

return (
<Box
Expand Down

0 comments on commit f185f8b

Please sign in to comment.