Skip to content

Commit

Permalink
[RELEASE] Release tangle-dapp v0.0.17 (#2652)
Browse files Browse the repository at this point in the history
  • Loading branch information
AtelyPham authored Nov 13, 2024
1 parent 3ca9097 commit 71035fc
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 34 deletions.
19 changes: 19 additions & 0 deletions apps/tangle-dapp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 0.0.17 (2024-11-13)


### 🚀 Features

- **tangle-dapp:** Implement LS pool modal: Update commission ([#2630](https://github.com/webb-tools/webb-dapp/pull/2630))

- **tangle-dapp:** Show validator address when avatar is hovered ([#2641](https://github.com/webb-tools/webb-dapp/pull/2641))

- **tangle-dapp:** Add LST selection modal ([#2644](https://github.com/webb-tools/webb-dapp/pull/2644))

- **tangle-cloud:** Configure Layout, Network, and Wallet ([#2651](https://github.com/webb-tools/webb-dapp/pull/2651))


### ❤️ Thank You

- Trung-Tin Pham @AtelyPham
- Yurixander @yurixander

## 0.0.16 (2024-11-04)

### 🚀 Features
Expand Down
2 changes: 1 addition & 1 deletion apps/tangle-dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webb-tools/tangle-dapp",
"version": "0.0.16",
"version": "0.0.17",
"license": "Apache-2.0",
"type": "commonjs"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ import useLocalStorage, {
import usePromise from '../../hooks/usePromise';
import useSubstrateInjectedExtension from '../../hooks/useSubstrateInjectedExtension';
import { getApiPromise } from '../../utils/polkadot/api';
import { useActiveWallet } from '@webb-tools/api-provider-environment/hooks/useActiveWallet';

const UpdateMetadataButton: FC = () => {
const [isHidden, setIsHidden] = useState(false);

const [activeAccount] = useActiveAccount();
const [activeWallet] = useActiveWallet();
const injector = useSubstrateInjectedExtension();
const { network } = useNetworkStore();

Expand All @@ -52,41 +54,44 @@ const UpdateMetadataButton: FC = () => {
[setCache],
);

const isMetadataUpToDate = useMemo(() => {
// Only update metadata for the mainnet. This is because
// the testnet and local networks have the same genesis hash,
// so they represent the same network. Only the mainnet's metadata
// is relevant.
if (apiPromise === null || network.id !== NetworkId.TANGLE_MAINNET) {
return null;
}

const genesisHash = apiPromise.genesisHash.toHex();
const cachedEntry = cachedMetadata?.value?.[genesisHash];

if (cachedEntry === undefined) {
return false;
}

return isEqual(cachedEntry, {
ss58Prefix: network.ss58Prefix,
tokenSymbol: network.tokenSymbol,
tokenDecimals: TANGLE_TOKEN_DECIMALS,
});
}, [
apiPromise,
cachedMetadata?.value,
network.id,
network.ss58Prefix,
network.tokenSymbol,
]);

const isSubstrateAccount = useMemo(
() =>
activeAccount !== null ? isSubstrateAddress(activeAccount.address) : null,
[activeAccount],
const isMetadataUpToDate = useMemo(
() => {
// Only update metadata for the mainnet. This is because
// the testnet and local networks have the same genesis hash,
// so they represent the same network. Only the mainnet's metadata
// is relevant.
if (apiPromise === null || network.id !== NetworkId.TANGLE_MAINNET) {
return null;
}

// If the active wallet is an EVM wallet, we don't need to update the metadata
if (activeWallet?.platform === 'EVM') {
return null;
}

const genesisHash = apiPromise.genesisHash.toHex();
const cachedEntry = cachedMetadata?.value?.[genesisHash];

if (cachedEntry === undefined) {
return false;
}

return isEqual(cachedEntry, {
ss58Prefix: network.ss58Prefix,
tokenSymbol: network.tokenSymbol,
tokenDecimals: TANGLE_TOKEN_DECIMALS,
});
},
// prettier-ignore
[activeWallet?.platform, apiPromise, cachedMetadata?.value, network.id, network.ss58Prefix, network.tokenSymbol],
);

const isSubstrateAccount = useMemo(() => {
return activeAccount !== null
? isSubstrateAddress(activeAccount.address)
: null;
}, [activeAccount]);

const handleClick = async () => {
if (
injector === null ||
Expand Down

0 comments on commit 71035fc

Please sign in to comment.