mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-08 03:08:21 +00:00
fix: SSR issue while localStorage is being accessed (#437)
This commit is contained in:
parent
7e8b65b36d
commit
3c127639c3
1 changed files with 10 additions and 1 deletions
|
|
@ -83,7 +83,16 @@ export function ConnectAIModal({
|
|||
const [cursorInstallTab, setCursorInstallTab] = useState<
|
||||
"oneClick" | "manual"
|
||||
>("oneClick")
|
||||
const projectId = localStorage.getItem("selectedProject") ?? "default"
|
||||
|
||||
const [projectId, setProjectId] = useState("default")
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
const storedProjectId =
|
||||
localStorage.getItem("selectedProject") ?? "default"
|
||||
setProjectId(storedProjectId)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
analytics.mcpViewOpened()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue