Skip to content

Commit

Permalink
fix: Add safe to added safes and address book
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed May 31, 2024
1 parent 42dad4b commit 9d40c0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/new-safe/create/steps/StatusStep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useCounter } from '@/components/common/Notifications/useCounter'
import type { StepRenderProps } from '@/components/new-safe/CardStepper/useCardStepper'
import type { NewSafeFormData } from '@/components/new-safe/create'
import { getRedirect } from '@/components/new-safe/create/logic'
import { updateAddressBook } from '@/components/new-safe/create/logic/address-book'
import StatusMessage from '@/components/new-safe/create/steps/StatusStep/StatusMessage'
import useUndeployedSafe from '@/components/new-safe/create/steps/StatusStep/useUndeployedSafe'
import lightPalette from '@/components/theme/lightPalette'
Expand All @@ -10,6 +11,7 @@ import { safeCreationPendingStatuses } from '@/features/counterfactual/hooks/use
import { SafeCreationEvent, safeCreationSubscribe } from '@/features/counterfactual/services/safeCreationEvents'
import { useCurrentChain } from '@/hooks/useChains'
import Rocket from '@/public/images/common/rocket.svg'
import { useAppDispatch } from '@/store'
import { Alert, AlertTitle, Box, Button, Paper, Stack, SvgIcon, Typography } from '@mui/material'
import Link from 'next/link'
import { useRouter } from 'next/router'
Expand All @@ -28,6 +30,7 @@ export const CreateSafeStatus = ({
const [safeAddress, pendingSafe] = useUndeployedSafe()
const router = useRouter()
const chain = useCurrentChain()
const dispatch = useAppDispatch()

const counter = useCounter(pendingSafe?.status.submittedAt)

Expand All @@ -51,9 +54,10 @@ export const CreateSafeStatus = ({
if (!chain || !safeAddress) return

if (status === SafeCreationEvent.SUCCESS) {
dispatch(updateAddressBook(chain.chainId, safeAddress, data.name, data.owners, data.threshold))
router.push(getRedirect(chain.shortName, safeAddress, router.query?.safeViewRedirectURL))
}
}, [chain, router, safeAddress, status])
}, [chain, data.name, data.owners, data.threshold, router, safeAddress, status])

Check warning on line 60 in src/components/new-safe/create/steps/StatusStep/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint Results

react-hooks/exhaustive-deps

React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array. * [SUGGESTION] Update the dependencies array to be: [chain, data.name, data.owners, data.threshold, dispatch, router, safeAddress, status]

useEffect(() => {
if (!setProgressColor) return
Expand Down

0 comments on commit 9d40c0a

Please sign in to comment.