Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Multichain] fix: Copy owners to address book when replaying safe [SW-270] #4355

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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({
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I added this already in the past but this prevents the success screen from being shown until the dashboard is opened otherwise it pops up immediately even while still seeing the review screen in the background

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)
usame-algan marked this conversation as resolved.
Show resolved Hide resolved

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
Loading