From f74f9da236be3f4bd7a07081e00a78dcae7afa40 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Tue, 19 Mar 2024 10:30:11 +0100 Subject: [PATCH] Fix issue with empty ticker --- .changelog/1336.bugfix.md | 3 +++ src/oasis-nexus/api.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .changelog/1336.bugfix.md diff --git a/.changelog/1336.bugfix.md b/.changelog/1336.bugfix.md new file mode 100644 index 000000000..fc344865e --- /dev/null +++ b/.changelog/1336.bugfix.md @@ -0,0 +1,3 @@ +Fix issue with empty ticker + +- tx.body.amount.Denomination can be an empty string diff --git a/src/oasis-nexus/api.ts b/src/oasis-nexus/api.ts index e5da8f9fa..cc33435a7 100644 --- a/src/oasis-nexus/api.ts +++ b/src/oasis-nexus/api.ts @@ -192,7 +192,7 @@ export const useGetRuntimeTransactions: typeof generated.useGetRuntimeTransactio layer: runtime, network, ticker: - tx.body?.amount?.Denomination ?? getTokensForScope({ network, layer: runtime })[0].ticker, + tx.body?.amount?.Denomination || getTokensForScope({ network, layer: runtime })[0].ticker, method: adjustRuntimeTransactionMethod(tx.method, tx.is_likely_native_token_transfer), } }), @@ -259,7 +259,7 @@ export const useGetRuntimeTransactionsTxHash: typeof generated.useGetRuntimeTran layer: runtime, network, ticker: - tx.body?.amount?.Denomination ?? getTokensForScope({ network, layer: runtime })[0].ticker, + tx.body?.amount?.Denomination || getTokensForScope({ network, layer: runtime })[0].ticker, method: adjustRuntimeTransactionMethod(tx.method, tx.is_likely_native_token_transfer), } }),