Fix (#777)
This commit is contained in:
parent
9d784922f2
commit
162ff84108
|
@ -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 <IconText iconUrl={typeToIcon[txType]} text={typeToLabel[txType]} />
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue