mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-04 10:30:00 -06:00
remove session from formbricks-app feedback button
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import clsx from "clsx";
|
||||
import { usePlausible } from "next-plausible";
|
||||
import Script from "next/script";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
|
||||
declare global {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import clsx from "clsx";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
|
||||
declare global {
|
||||
@@ -15,7 +14,6 @@ const feedbackEnabled = !!(
|
||||
export function FeedbackButton() {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const feedbackRef = useRef<HTMLInputElement>(null);
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
useEffect(() => {
|
||||
if (feedbackEnabled) {
|
||||
@@ -36,28 +34,23 @@ export function FeedbackButton() {
|
||||
}, [feedbackRef, isOpen]);
|
||||
|
||||
useEffect(() => {
|
||||
window.formbricks = {
|
||||
...window.formbricks,
|
||||
config: {
|
||||
hqUrl: process.env.NEXT_PUBLIC_FORMBRICKS_URL,
|
||||
formId: process.env.NEXT_PUBLIC_FORMBRICKS_FORM_ID,
|
||||
divId: "formbricks-feedback-wrapper",
|
||||
contact: {
|
||||
name: "Matti",
|
||||
position: "Co-Founder",
|
||||
imgUrl: "https://avatars.githubusercontent.com/u/675065?s=128&v=4",
|
||||
},
|
||||
},
|
||||
};
|
||||
// @ts-ignore
|
||||
import("@formbricks/feedback");
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (status !== "loading" && feedbackEnabled) {
|
||||
window.formbricks = {
|
||||
...window.formbricks,
|
||||
config: {
|
||||
hqUrl: process.env.NEXT_PUBLIC_FORMBRICKS_URL,
|
||||
formId: process.env.NEXT_PUBLIC_FORMBRICKS_FORM_ID,
|
||||
divId: "formbricks-feedback-wrapper",
|
||||
contact: {
|
||||
name: "Matti",
|
||||
position: "Co-Founder",
|
||||
imgUrl: "https://avatars.githubusercontent.com/u/675065?s=128&v=4",
|
||||
},
|
||||
customer: session?.user,
|
||||
},
|
||||
};
|
||||
}
|
||||
}, [status, session]);
|
||||
|
||||
if (!feedbackEnabled) return null;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user