Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

🩹(frontend) prevent support toggle when Crisp chat is blocked

lebaudantoine6e0948c696cf
diff --git a/src/frontend/src/features/support/hooks/useSupport.tsx b/src/frontend/src/features/support/hooks/useSupport.tsx
index 9cbe94aa..4888fb90 100644
--- a/src/frontend/src/features/support/hooks/useSupport.tsx
+++ b/src/frontend/src/features/support/hooks/useSupport.tsx
@@ -31,7 +31,17 @@ export const useSupport = ({ id }: useSupportProps) => {
return null
}
+// Some users may block Crisp chat widget with browser ad blockers or anti-tracking plugins
+// So we need to safely check if Crisp is available and not blocked
+const isCrispAvailable = () => {
+ try {
+ return !!window?.$crisp?.is
+ } catch {
+ return false
+ }
+}
+
export const useIsSupportEnabled = () => {
const { data } = useConfig()
- return !!data?.support?.id
+ return !!data?.support?.id && isCrispAvailable()
}