Skip to content

Commit

Permalink
Fe/fix white screen (#1551)
Browse files Browse the repository at this point in the history
* fix

* ..

---------

Co-authored-by: Jonah Lin <[email protected]>
  • Loading branch information
bigboydiamonds and bigboydiamonds authored Nov 9, 2023
1 parent c1f8150 commit 4936a4a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
30 changes: 15 additions & 15 deletions packages/synapse-interface/slices/transactions/updater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
))
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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)
)
Expand All @@ -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
}
Expand All @@ -287,15 +287,15 @@ export default function Updater(): null {
pendingBridgeTransactions.forEach(
(pendingBridgeTransaction: PendingBridgeTransaction) => {
const isCompleted: boolean =
userHistoricalTransactions.some(
userHistoricalTransactions?.some(
(historicalTransaction: BridgeTransaction) => {
return (
historicalTransaction.fromInfo.txnHash ===
pendingBridgeTransaction.transactionHash
)
}
) ||
fallbackQueryHistoricalTransactions.some(
fallbackQueryHistoricalTransactions?.some(
(historicalTransaction: BridgeTransaction) => {
return (
historicalTransaction.fromInfo.txnHash ===
Expand Down Expand Up @@ -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)
Expand All @@ -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
)
Expand Down Expand Up @@ -385,7 +385,7 @@ export default function Updater(): null {
fallbackQueryHistoricalTransactions.forEach(
(fallbackTransaction: BridgeTransaction) => {
if (
userHistoricalTransactions.some(
userHistoricalTransactions?.some(
(historicalTransaction: BridgeTransaction) =>
historicalTransaction.kappa === fallbackTransaction.kappa
)
Expand All @@ -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
)
Expand All @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const useFallbackBridgeDestinationQuery = ({
)

const destinationQueryAlreadySaved: boolean =
fallbackQueryHistoricalTransactions.some(
fallbackQueryHistoricalTransactions?.some(
(transaction: BridgeTransaction) =>
transaction?.toInfo === destinationInfo
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4936a4a

Please sign in to comment.