add warmup call to pmfwidget;

This commit is contained in:
Matthias Nannt
2023-01-27 14:49:13 +01:00
parent 50a9c2bc8a
commit 0d832b65b3
4 changed files with 21 additions and 10 deletions
+5 -5
View File
@@ -3,7 +3,7 @@ import { useEffect, useRef, useState } from "react";
declare global {
interface Window {
formbricks: any;
formbricksPmf: any;
}
}
@@ -12,8 +12,8 @@ export default function PmfButton() {
const feedbackRef = useRef<HTMLInputElement>(null);
useEffect(() => {
window.formbricks = {
...window.formbricks,
window.formbricksPmf = {
...window.formbricksPmf,
config: {
formbricksUrl: "http://localhost:3000",
formId: "cldbru2nu000s19t6mtc4bhk4",
@@ -70,8 +70,8 @@ export default function PmfButton() {
onClick={() => {
if (!isOpen) {
if (window) {
window.formbricks.init();
window.formbricks.reset();
window.formbricksPmf.init();
window.formbricksPmf.reset();
}
}
setIsOpen(!isOpen);