From 162ff841082e3d8f6f89386a807c73b80f9c099e Mon Sep 17 00:00:00 2001 From: nicolas Date: Fri, 24 Apr 2020 09:32:19 -0300 Subject: [PATCH] Fix (#777) --- .../components/Transactions/TxsTable/TxType/index.jsx | 10 +++++++--- .../safe/components/Transactions/TxsTable/columns.js | 2 +- src/routes/safe/store/models/transaction.js | 10 +--------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/routes/safe/components/Transactions/TxsTable/TxType/index.jsx b/src/routes/safe/components/Transactions/TxsTable/TxType/index.jsx index 060ba740..fcb79665 100644 --- a/src/routes/safe/components/Transactions/TxsTable/TxType/index.jsx +++ b/src/routes/safe/components/Transactions/TxsTable/TxType/index.jsx @@ -31,26 +31,30 @@ const typeToLabel = { } const TxType = ({ origin, txType }: { txType: TransactionType, origin: string | null }) => { - const isThirdPartyApp = txType === 'third-party-app' const [loading, setLoading] = useState(true) const [appInfo, setAppInfo] = useState() + const [forceCustom, setForceCustom] = useState(false) useEffect(() => { const getAppInfo = async () => { const parsedOrigin = getAppInfoFromOrigin(origin) + if (!parsedOrigin) { + setForceCustom(true) + return + } const appInfo = await getAppInfoFromUrl(parsedOrigin.url) setAppInfo(appInfo) setLoading(false) } - if (!isThirdPartyApp) { + if (!origin) { return } getAppInfo() }, [txType]) - if (!isThirdPartyApp) { + if (forceCustom || !origin) { return } diff --git a/src/routes/safe/components/Transactions/TxsTable/columns.js b/src/routes/safe/components/Transactions/TxsTable/columns.js index 80b576ad..38e495c2 100644 --- a/src/routes/safe/components/Transactions/TxsTable/columns.js +++ b/src/routes/safe/components/Transactions/TxsTable/columns.js @@ -75,7 +75,7 @@ const getTransactionTableData = (tx: Transaction, cancelTx: ?Transaction): Trans } else if (tx.cancellationTx) { txType = 'cancellation' } else if (tx.customTx) { - txType = tx.origin ? 'third-party-app' : 'custom' + txType = 'custom' } else if (tx.creationTx) { txType = 'creation' } else if (tx.upgradeTx) { diff --git a/src/routes/safe/store/models/transaction.js b/src/routes/safe/store/models/transaction.js index 39b1440f..a6349cbd 100644 --- a/src/routes/safe/store/models/transaction.js +++ b/src/routes/safe/store/models/transaction.js @@ -7,14 +7,7 @@ import { type Confirmation } from '~/routes/safe/store/models/confirmation' export const OUTGOING_TX_TYPE = 'outgoing' -export type TransactionType = - | 'incoming' - | 'outgoing' - | 'settings' - | 'custom' - | 'creation' - | 'cancellation' - | 'third-party-app' +export type TransactionType = 'incoming' | 'outgoing' | 'settings' | 'custom' | 'creation' | 'cancellation' export type TransactionStatus = | 'awaiting_your_confirmation' @@ -24,7 +17,6 @@ export type TransactionStatus = | 'cancelled' | 'awaiting_execution' | 'pending' - | 'third-party-app' export type TransactionProps = { nonce: ?number,