mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-10-12 02:01:57 +00:00
Merge branch 'Dokploy:canary' into fix/add-invitation-form-reset
This commit is contained in:
@@ -4,7 +4,7 @@ import { useEffect } from "react";
|
||||
import { api } from "@/utils/api";
|
||||
import { useWhitelabeling } from "@/utils/hooks/use-whitelabeling";
|
||||
import { ImpersonationBar } from "../dashboard/impersonation/impersonation-bar";
|
||||
import { HubSpotWidget } from "../shared/HubSpotWidget";
|
||||
import { useHubSpotChat } from "../shared/analytics";
|
||||
import Page from "./side";
|
||||
|
||||
interface Props {
|
||||
@@ -26,6 +26,7 @@ export const DashboardLayout = ({ children, metaName }: Props) => {
|
||||
});
|
||||
|
||||
const isChatEnabled = isCloud === true && currentPlan === "startup";
|
||||
useHubSpotChat(isChatEnabled);
|
||||
|
||||
const { data: onboardingStatus } = api.project.onboardingStatus.useQuery();
|
||||
const shouldRedirectToOnboarding =
|
||||
@@ -52,12 +53,6 @@ export const DashboardLayout = ({ children, metaName }: Props) => {
|
||||
</Head>
|
||||
)}
|
||||
<Page>{children}</Page>
|
||||
{isChatEnabled && (
|
||||
<>
|
||||
<HubSpotWidget />
|
||||
</>
|
||||
)}
|
||||
|
||||
{haveRootAccess === true && <ImpersonationBar />}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import Script from "next/script";
|
||||
|
||||
export const HubSpotWidget = () => {
|
||||
return (
|
||||
<Script
|
||||
id="hs-script-loader"
|
||||
type="text/javascript"
|
||||
src="//js-eu1.hs-scripts.com/147033433.js"
|
||||
strategy="lazyOnload"
|
||||
async
|
||||
defer
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -92,5 +92,11 @@ export const useHubSpotChat = (enabled: boolean) => {
|
||||
loadWidget,
|
||||
];
|
||||
}
|
||||
return () => {
|
||||
window.hsConversationsOnReady = window.hsConversationsOnReady?.filter(
|
||||
(callback) => callback !== loadWidget,
|
||||
);
|
||||
window.HubSpotConversations?.widget.remove();
|
||||
};
|
||||
}, [enabled]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user