Skip to content

Commit

Permalink
add backup in case basePath isn't defined (#426)
Browse files Browse the repository at this point in the history
Co-authored-by: Alyssa Wang <[email protected]>
  • Loading branch information
AlyssaWang and AlyssaWang authored Jan 5, 2024
1 parent 95adb9b commit ec13589
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/src/components/SuiteOptionsPage/SuiteOptionsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ const SuiteOptionsPage: FC<SuiteOptionsPageProps> = ({ testSuite }) => {
if (testSession && testSession.test_suite) {
navigate(`/${testSession.test_suite_id}/${testSession.id}`);
// Use window navigation as a workaround for router errors
window.location.href = `/${basePath}/${testSession.test_suite_id}/${testSession.id}`;
const root = basePath ? `/${basePath}` : window.location.origin;
window.location.href = `${root}/${testSession.test_suite_id}/${testSession.id}`;
}
})
.catch((e: Error) => {
Expand Down

0 comments on commit ec13589

Please sign in to comment.