Skip to content

Commit

Permalink
feat: use current location as href instead of empty string (#4331)
Browse files Browse the repository at this point in the history
it directs users to root instead of the same page as should be expected
  • Loading branch information
karrui authored Jul 26, 2022
1 parent 48597b4 commit 24d6d92
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export const PreviewFormProvider = ({
),
description: (
<Text as="span">
<Link href="">Refresh</Link> for the latest version of the form.
<Link href={window.location.href}>Refresh</Link> for the latest
version of the form.
</Text>
),
duration: null,
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/features/public-form/PublicFormProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ export const PublicFormProvider = ({
),
description: (
<Text as="span">
<Link href="">Refresh</Link> for the latest version of the form.
<Link href={window.location.href}>Refresh</Link> for the latest
version of the form.
</Text>
),
duration: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const FormEndPageContainer = ({
})
}
},
[submitFormFeedbackMutation, toast],
[isPreview, submitFormFeedbackMutation, toast],
)

if (!form || !submissionData) return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const EndPageBlock = ({
<Box mt="2.25rem">
<Button
as="a"
href={endPage.buttonLink ?? ''}
href={endPage.buttonLink ?? window.location.href}
variant="solid"
colorScheme={`theme-${colorTheme}`}
>
Expand Down

0 comments on commit 24d6d92

Please sign in to comment.