From 4936a4a49c8d6cf88261b7161bb15e28aaa565d1 Mon Sep 17 00:00:00 2001 From: jonah <57741810+bigboydiamonds@users.noreply.github.com> Date: Wed, 8 Nov 2023 19:07:15 -0800 Subject: [PATCH] Fe/fix white screen (#1551) * fix * .. --------- Co-authored-by: Jonah Lin <57741810+linjonah@users.noreply.github.com> --- .../Transaction/MostRecentTransaction.tsx | 2 +- .../slices/transactions/updater.tsx | 30 +++++++++---------- .../useFallbackBridgeDestinationQuery.tsx | 2 +- .../hooks/useFallbackBridgeOriginQuery.tsx | 8 ++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/synapse-interface/components/Portfolio/Transaction/MostRecentTransaction.tsx b/packages/synapse-interface/components/Portfolio/Transaction/MostRecentTransaction.tsx index 613a73b4af..14aca99708 100644 --- a/packages/synapse-interface/components/Portfolio/Transaction/MostRecentTransaction.tsx +++ b/packages/synapse-interface/components/Portfolio/Transaction/MostRecentTransaction.tsx @@ -123,7 +123,7 @@ export const MostRecentTransaction = () => { if (!seenHistoricalTransactions || !userHistoricalTransactions) { return false } else { - return seenHistoricalTransactions.some( + return seenHistoricalTransactions?.some( (transaction: BridgeTransaction) => transaction.kappa === (lastHistoricalTransaction.kappa as BridgeTransaction) diff --git a/packages/synapse-interface/slices/transactions/updater.tsx b/packages/synapse-interface/slices/transactions/updater.tsx index 837d93c97e..1abcb5fc4d 100644 --- a/packages/synapse-interface/slices/transactions/updater.tsx +++ b/packages/synapse-interface/slices/transactions/updater.tsx @@ -171,17 +171,17 @@ export default function Updater(): null { ?.filter( (recentTx) => (userPendingTransactions && - userPendingTransactions.some( + userPendingTransactions?.some( (pendingTx: BridgeTransaction) => pendingTx.fromInfo.txnHash === recentTx.transactionHash )) || (userHistoricalTransactions && - userHistoricalTransactions.some( + userHistoricalTransactions?.some( (historicalTx: BridgeTransaction) => historicalTx.fromInfo.txnHash === recentTx.transactionHash )) || (fallbackQueryPendingTransactions && - fallbackQueryPendingTransactions.some( + fallbackQueryPendingTransactions?.some( (pendingTx: BridgeTransaction) => pendingTx.fromInfo.txnHash === recentTx.transactionHash )) @@ -214,7 +214,7 @@ export default function Updater(): null { if (hasUserPendingTransactions) { userPendingTransactions.forEach( (pendingTransaction: BridgeTransaction) => { - const isStored: boolean = pendingAwaitingCompletionTransactions.some( + const isStored: boolean = pendingAwaitingCompletionTransactions?.some( (storedTransaction: BridgeTransaction) => storedTransaction.kappa === pendingTransaction.kappa ) @@ -243,7 +243,7 @@ export default function Updater(): null { const mostRecentHistoricalTransaction: BridgeTransaction = userHistoricalTransactions[0] - const isTransactionAlreadySeen = seenHistoricalTransactions.some( + const isTransactionAlreadySeen = seenHistoricalTransactions?.some( (transaction: BridgeTransaction) => transaction === (mostRecentHistoricalTransaction as BridgeTransaction) ) @@ -257,12 +257,12 @@ export default function Updater(): null { pendingAwaitingCompletionTransactions.forEach( (pendingTransaction: BridgeTransaction) => { const isCompleted: boolean = - userHistoricalTransactions.some( + userHistoricalTransactions?.some( (historicalTransaction: BridgeTransaction) => { return historicalTransaction.kappa === pendingTransaction.kappa } ) || - fallbackQueryHistoricalTransactions.some( + fallbackQueryHistoricalTransactions?.some( (historicalTransaction: BridgeTransaction) => { return historicalTransaction.kappa === pendingTransaction.kappa } @@ -287,7 +287,7 @@ export default function Updater(): null { pendingBridgeTransactions.forEach( (pendingBridgeTransaction: PendingBridgeTransaction) => { const isCompleted: boolean = - userHistoricalTransactions.some( + userHistoricalTransactions?.some( (historicalTransaction: BridgeTransaction) => { return ( historicalTransaction.fromInfo.txnHash === @@ -295,7 +295,7 @@ export default function Updater(): null { ) } ) || - fallbackQueryHistoricalTransactions.some( + fallbackQueryHistoricalTransactions?.some( (historicalTransaction: BridgeTransaction) => { return ( historicalTransaction.fromInfo.txnHash === @@ -326,7 +326,7 @@ export default function Updater(): null { const mostRecentFallbackHistoricalTransaction: BridgeTransaction = fallbackQueryHistoricalTransactions[0] - const isTransactionAlreadySeen = seenHistoricalTransactions.some( + const isTransactionAlreadySeen = seenHistoricalTransactions?.some( (transaction: BridgeTransaction) => transaction.kappa === (mostRecentFallbackHistoricalTransaction.kappa as BridgeTransaction) @@ -351,11 +351,11 @@ export default function Updater(): null { const { fromInfo, toInfo, kappa } = transaction const alreadyMovedToHistorical: boolean = - fallbackQueryHistoricalTransactions.some( + fallbackQueryHistoricalTransactions?.some( (historicalTransaction: BridgeTransaction) => historicalTransaction !== transaction ) || - userHistoricalTransactions.some( + userHistoricalTransactions?.some( (historicalTransaction: BridgeTransaction) => historicalTransaction !== transaction ) @@ -385,7 +385,7 @@ export default function Updater(): null { fallbackQueryHistoricalTransactions.forEach( (fallbackTransaction: BridgeTransaction) => { if ( - userHistoricalTransactions.some( + userHistoricalTransactions?.some( (historicalTransaction: BridgeTransaction) => historicalTransaction.kappa === fallbackTransaction.kappa ) @@ -408,7 +408,7 @@ export default function Updater(): null { if (checkTransactionsExist(fallbackQueryHistoricalTransactions)) { fallbackQueryHistoricalTransactions.forEach( (fallbackHistoricalTransaction: BridgeTransaction) => { - const matched: boolean = fallbackQueryPendingTransactions.some( + const matched: boolean = fallbackQueryPendingTransactions?.some( (pendingTransaction: BridgeTransaction) => pendingTransaction.kappa === fallbackHistoricalTransaction.kappa ) @@ -426,7 +426,7 @@ export default function Updater(): null { if (checkTransactionsExist(fallbackQueryPendingTransactions)) { fallbackQueryPendingTransactions.forEach( (fallbackPendingTransaction: BridgeTransaction) => { - const matched: boolean = userHistoricalTransactions.some( + const matched: boolean = userHistoricalTransactions?.some( (pendingTransaction: BridgeTransaction) => pendingTransaction.kappa === fallbackPendingTransaction.kappa ) diff --git a/packages/synapse-interface/utils/hooks/useFallbackBridgeDestinationQuery.tsx b/packages/synapse-interface/utils/hooks/useFallbackBridgeDestinationQuery.tsx index f460a51663..9b9aab1cc2 100644 --- a/packages/synapse-interface/utils/hooks/useFallbackBridgeDestinationQuery.tsx +++ b/packages/synapse-interface/utils/hooks/useFallbackBridgeDestinationQuery.tsx @@ -113,7 +113,7 @@ export const useFallbackBridgeDestinationQuery = ({ ) const destinationQueryAlreadySaved: boolean = - fallbackQueryHistoricalTransactions.some( + fallbackQueryHistoricalTransactions?.some( (transaction: BridgeTransaction) => transaction?.toInfo === destinationInfo ) diff --git a/packages/synapse-interface/utils/hooks/useFallbackBridgeOriginQuery.tsx b/packages/synapse-interface/utils/hooks/useFallbackBridgeOriginQuery.tsx index 64e6acf8cc..be7f00ce23 100644 --- a/packages/synapse-interface/utils/hooks/useFallbackBridgeOriginQuery.tsx +++ b/packages/synapse-interface/utils/hooks/useFallbackBridgeOriginQuery.tsx @@ -49,7 +49,7 @@ export const useFallbackBridgeOriginQuery = ({ }, [chainId, txnHash, bridgeType]) const queryTransactionAlreadyStored: boolean = useMemo(() => { - return fallbackQueryPendingTransactions.some((transaction) => { + return fallbackQueryPendingTransactions?.some((transaction) => { return transaction?.fromInfo?.txnHash === txnHash }) }, [fallbackQueryPendingTransactions, txnHash]) @@ -96,17 +96,17 @@ export const useFallbackBridgeOriginQuery = ({ } const alreadyExists: boolean = - fallbackQueryPendingTransactions.some( + fallbackQueryPendingTransactions?.some( (transaction) => transaction.kappa === constructedBridgeTransaction.kappa || transaction.fromInfo === constructedBridgeTransaction.fromInfo ) || - fallbackQueryHistoricalTransactions.some( + fallbackQueryHistoricalTransactions?.some( (transaction) => transaction.kappa === constructedBridgeTransaction.kappa || transaction.fromInfo === constructedBridgeTransaction.fromInfo ) || - userHistoricalTransactions.some( + userHistoricalTransactions?.some( (transaction) => transaction.kappa === constructedBridgeTransaction.kappa || transaction.fromInfo === constructedBridgeTransaction.fromInfo