Skip to content

Commit

Permalink
fix: add query param to settings link
Browse files Browse the repository at this point in the history
  • Loading branch information
schmanu committed Apr 30, 2024
1 parent a4b394e commit e876b19
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/tx-flow/flows/SignMessage/SignMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { useAppSelector } from '@/store'
import { selectBlindSigning } from '@/store/settingsSlice'
import NextLink from 'next/link'
import { AppRoutes } from '@/config/routes'
import { useRouter } from 'next/router'

const createSkeletonMessage = (confirmationsRequired: number): SafeMessage => {
return {
Expand Down Expand Up @@ -155,14 +156,17 @@ const BlindSigningWarning = ({
isBlindSigningEnabled: boolean
isBlindSigningPayload: boolean
}) => {
const router = useRouter()
const query = router.query.safe ? { safe: router.query.safe } : undefined

if (!isBlindSigningPayload) {
return null
}

return (
<ErrorMessage level={isBlindSigningEnabled ? 'warning' : 'error'}>
This request involves{' '}
<Link component={NextLink} href={AppRoutes.settings.securityLogin}>
<Link component={NextLink} href={{ pathname: AppRoutes.settings.securityLogin, query }}>
blind signing
</Link>
, which can lead to unpredictable outcomes.
Expand All @@ -172,7 +176,7 @@ const BlindSigningWarning = ({
) : (
<>
If you wish to proceed, you must first{' '}
<Link component={NextLink} href={AppRoutes.settings.securityLogin}>
<Link component={NextLink} href={{ pathname: AppRoutes.settings.securityLogin, query }}>
enable blind signing
</Link>
.
Expand Down

0 comments on commit e876b19

Please sign in to comment.