mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-03 11:30:50 -05:00
fix: refetch server data when share embed modal is closed (#2185)
This commit is contained in:
+5
@@ -5,6 +5,7 @@ import { ArrowLeftIcon, CodeBracketIcon, EnvelopeIcon, LinkIcon } from "@heroico
|
||||
import { DocumentDuplicateIcon } from "@heroicons/react/24/solid";
|
||||
import { BellRing, BlocksIcon, Code2Icon, RefreshCcw } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
@@ -28,6 +29,7 @@ interface ShareEmbedSurveyProps {
|
||||
user: TUser;
|
||||
}
|
||||
export default function ShareEmbedSurvey({ survey, open, setOpen, webAppUrl, user }: ShareEmbedSurveyProps) {
|
||||
const router = useRouter();
|
||||
const environmentId = survey.environmentId;
|
||||
const isSingleUseLinkSurvey = survey.singleUse?.enabled ?? false;
|
||||
const { email } = user;
|
||||
@@ -73,6 +75,9 @@ export default function ShareEmbedSurvey({ survey, open, setOpen, webAppUrl, use
|
||||
setActiveId(tabs[0].id);
|
||||
setOpen(open);
|
||||
setShowInitialPage(open); // Reset to initial page when modal opens
|
||||
|
||||
// fetch latest responses
|
||||
router.refresh();
|
||||
};
|
||||
|
||||
const handleInitialPageButton = () => {
|
||||
|
||||
Reference in New Issue
Block a user