Skip to content

Commit

Permalink
Merge pull request #317 from axelarnetwork/develop
Browse files Browse the repository at this point in the history
0.4.3
  • Loading branch information
alanrsoares authored Apr 20, 2023
2 parents 9b3e3ca + af5e9ee commit 4277c66
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axelar-satellite",
"version": "0.4.2",
"version": "0.4.3",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
9 changes: 7 additions & 2 deletions src/components/common/ConnectIndicator.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import React from "react";
import Image from "next/image";
import { pick } from "rambda";

import { useWalletStore } from "~/store";

import { useIsTerraConnected } from "~/hooks/terra/useIsTerraConnected";

export const ConnectIndicator = () => {
const { wagmiConnected, keplrConnected, wagmiConnectorId } = useWalletStore();
const { wagmiConnected, keplrConnected, wagmiConnectorId } = useWalletStore(
pick(["wagmiConnected", "keplrConnected", "wagmiConnectorId"])
);
const { isTerraConnected } = useIsTerraConnected();

return (
Expand All @@ -27,7 +30,9 @@ export const ConnectIndicator = () => {
<Image
height={25}
width={25}
src={`/assets/wallets/${wagmiConnectorId?.toLowerCase()}.logo.svg`}
src={`/assets/wallets/${
wagmiConnectorId?.toLowerCase() ?? "metamask"
}.logo.svg`}
alt={`${wagmiConnectorId} Logo`}
/>
)}
Expand Down
21 changes: 8 additions & 13 deletions src/store/stores/swap-store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,25 +132,20 @@ export const useSwapStore = create<SwapStore>()(
false,
"setDestAddress"
),
setAsset: (_asset) => {
setAsset: (asset) => {
const { allAssets, destChain } = get();
let asset = _asset;

if (
_asset &&
_asset.gas_token_id &&
destChain.chainName.toLowerCase() === _asset.native_chain
) {
const nativeAsset = allAssets.find((t) => t.id === _asset.gas_token_id);
const shouldUseNativeAsset =
asset?.gas_token_id &&
destChain.chainName.toLowerCase() === asset.native_chain;

if (nativeAsset) {
asset = nativeAsset;
}
}
const nativeAsset = shouldUseNativeAsset
? allAssets.find((t) => t.id === asset.gas_token_id)
: undefined;

set(
{
asset,
asset: nativeAsset ?? asset,
},
false,
"setAsset"
Expand Down
2 changes: 1 addition & 1 deletion src/store/stores/wallet-store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useWalletStore = create<WalletStore>()(
persist(
(set, _get) => ({
...initialWalletState,
setWagmiConnected: (wagmiConnected, connectorId) =>
setWagmiConnected: (wagmiConnected, connectorId = "metaMask") =>
set({
wagmiConnected,
wagmiConnectorId: connectorId,
Expand Down

1 comment on commit 4277c66

@vercel
Copy link

@vercel vercel bot commented on 4277c66 Apr 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.