-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add crisp support chat back #725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,7 @@ | ||||||||||||||
| "use client"; | ||||||||||||||
|
|
||||||||||||||
| import { Suspense } from "react"; | ||||||||||||||
| import dynamic from "next/dynamic"; | ||||||||||||||
| import { usePathname } from "next/navigation"; | ||||||||||||||
| import { Toaster } from "@/components/Toast"; | ||||||||||||||
| import { NavBottom } from "@/components/NavBottom"; | ||||||||||||||
|
|
@@ -12,6 +14,8 @@ import { SideNav } from "@/components/SideNav"; | |||||||||||||
| import { SidebarRight } from "@/components/SidebarRight"; | ||||||||||||||
| import { cn } from "@/utils"; | ||||||||||||||
|
|
||||||||||||||
| const CrispWithNoSSR = dynamic(() => import("@/components/CrispChat")); | ||||||||||||||
|
|
||||||||||||||
| function ContentWrapper({ children }: { children: React.ReactNode }) { | ||||||||||||||
| const { state } = useSidebar(); | ||||||||||||||
| const isRightSidebarOpen = state.includes("chat-sidebar"); | ||||||||||||||
|
|
@@ -33,6 +37,9 @@ function ContentWrapper({ children }: { children: React.ReactNode }) { | |||||||||||||
| <NavBottom /> | ||||||||||||||
| </div> | ||||||||||||||
| </SidebarInset> | ||||||||||||||
| <Suspense> | ||||||||||||||
| <CrispWithNoSSR /> | ||||||||||||||
| </Suspense> | ||||||||||||||
|
Comment on lines
+40
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Provide a Suspense fallback React’s Suspense expects a fallback; also now that dynamic uses suspense: true, this will render correctly. Apply: - <Suspense>
- <CrispWithNoSSR />
- </Suspense>
+ <Suspense fallback={null}>
+ <CrispWithNoSSR />
+ </Suspense>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| </div> | ||||||||||||||
| ); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| v2.6.12 | ||
| v2.6.13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Make the dynamic import truly client-only and Suspense-aware
Without options, dynamic can attempt SSR and your Suspense wrapper won’t take effect. Enable no-SSR and Suspense.
Apply:
📝 Committable suggestion
🤖 Prompt for AI Agents