Skip to content

Commit

Permalink
fix: Copy owners to address book when replaying safe
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Oct 10, 2024
1 parent 606cc03 commit 07f9ed7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/new-safe/create/steps/ReviewStep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const ReviewStep = ({ data, onSubmit, onBack, setStep }: StepRenderProps<NewSafe
gtmSetChainId(chain.chainId)

if (isCounterfactualEnabled && payMethod === PayMethod.PayLater) {
router?.push({
await router?.push({
pathname: AppRoutes.home,
query: { safe: `${data.networks[0].shortName}:${safeAddress}` },
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import ModalDialog from '@/components/common/ModalDialog'
import NetworkInput from '@/components/common/NetworkInput'
import { updateAddressBook } from '@/components/new-safe/create/logic/address-book'
import ErrorMessage from '@/components/tx/ErrorMessage'
import useAddressBook from '@/hooks/useAddressBook'
import { CREATE_SAFE_CATEGORY, CREATE_SAFE_EVENTS, OVERVIEW_EVENTS, trackEvent } from '@/services/analytics'
import { gtmSetChainId } from '@/services/analytics/gtm'
import { showNotification } from '@/store/notificationsSlice'
Expand Down Expand Up @@ -60,6 +61,7 @@ const ReplaySafeDialog = ({
})
const { handleSubmit, formState } = formMethods
const router = useRouter()
const addressBook = useAddressBook()

const customRpc = useAppSelector(selectRpc)
const dispatch = useAppDispatch()
Expand All @@ -73,6 +75,7 @@ const ReplaySafeDialog = ({
trackEvent({ ...OVERVIEW_EVENTS.CANCEL_ADD_NEW_NETWORK })
onClose()
}
console.log(addressBook)

const onFormSubmit = handleSubmit(async (data) => {
setIsSubmitting(true)
Expand Down Expand Up @@ -127,7 +130,10 @@ const ReplaySafeDialog = ({
[selectedChain.chainId],
safeAddress,
currentName || '',
safeCreationData.safeAccountConfig.owners.map((owner) => ({ address: owner, name: '' })),
safeCreationData.safeAccountConfig.owners.map((owner) => ({
address: owner,
name: addressBook[owner] || '',
})),
safeCreationData.safeAccountConfig.threshold,
),
)
Expand Down

0 comments on commit 07f9ed7

Please sign in to comment.