Skip to content

Commit

Permalink
Replace isBridgePaused with chain disabled prop
Browse files Browse the repository at this point in the history
  • Loading branch information
bigboydiamonds committed Mar 13, 2024
1 parent 873bd02 commit e5ed8ab
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions packages/synapse-interface/pages/state-managed-bridge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -553,22 +553,29 @@ const StateManagedBridge = () => {
// METIS_DOWNTIME_END_DATE
// )

const { isEcotoneForkUpgradePending, EcotoneForkCountdownProgressBar } =
useEcotoneForkCountdownProgress()
// const isBridgePaused = (): boolean => {
// if (isEcotoneForkUpgradePending) {
// if ([fromChainId, toChainId].includes(OPTIMISM.id)) return true
// if ([fromChainId, toChainId].includes(BASE.id)) return true
// }
// if (isMetisUpgradePending) {
// if ([fromChainId, toChainId].includes(METIS.id)) return true
// }
// return false
// }

const { isMetisUpgradePending, MetisUpgradeCountdownProgressBar } =
useMetisDowntimeCountdownProgress()
const {
isEcotoneForkUpgradePending,
isCurrentChainDisabled: isEcotoneUpgradeChainsDisabled,
EcotoneForkCountdownProgressBar,
} = useEcotoneForkCountdownProgress()

const {
isMetisUpgradePending,
isCurrentChainDisabled: isMetisUpgradeChainDisabled,
MetisUpgradeCountdownProgressBar,
} = useMetisDowntimeCountdownProgress()

const isBridgePaused = (): boolean => {
if (isEcotoneForkUpgradePending) {
if ([fromChainId, toChainId].includes(OPTIMISM.id)) return true
if ([fromChainId, toChainId].includes(BASE.id)) return true
}
if (isMetisUpgradePending) {
if ([fromChainId, toChainId].includes(METIS.id)) return true
}
return false
}
/* Remove after upgrades */

return (
Expand Down Expand Up @@ -672,7 +679,9 @@ const StateManagedBridge = () => {
isApproved={isApproved}
approveTxn={approveTxn}
executeBridge={executeBridge}
isBridgePaused={isBridgePaused()}
isBridgePaused={
isEcotoneUpgradeChainsDisabled || isMetisUpgradeChainDisabled
}
/>
</div>
</div>
Expand Down

0 comments on commit e5ed8ab

Please sign in to comment.