Skip to content

Commit

Permalink
Reload issue, use params to fetch data
Browse files Browse the repository at this point in the history
  • Loading branch information
sergesoroka committed May 28, 2024
1 parent 7ede3bd commit be01f70
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/SurveyComp/SurveyComp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
useIntermediateData,
} from "../store/store";

import { useLocation } from "react-router-dom";

import config from "../utils/config";

import "survey-core/defaultV2.min.css";
Expand All @@ -36,7 +38,11 @@ function SurveyComponent({ setResult }) {
const idShosen = useIsShosen();
const setIntermediateData = useSetIntermediateData();

const id = idShosen ? idShosen : UUID;
const location = useLocation();
const queryParams = new URLSearchParams(location.search);
const uuidParams = queryParams.get("uuid");

const id = idShosen ? idShosen : UUID || uuidParams;

// eslint-disable-next-line react-hooks/exhaustive-deps
async function getTemplateInfo() {
Expand Down

0 comments on commit be01f70

Please sign in to comment.