diff --git a/src/components/layouts/CheckConnection.tsx b/src/components/layouts/CheckConnection.tsx
index bb892bb..bad9456 100644
--- a/src/components/layouts/CheckConnection.tsx
+++ b/src/components/layouts/CheckConnection.tsx
@@ -1,15 +1,18 @@
'use client'
import { useAuthContext } from '@/features/auth/hooks/useAuth'
-import { postMessageParentDashboard } from '@/lib/copilot/hooks/app-bridge/postParentMessage'
+import { Overlay } from '@/features/sync/components/Overlay'
export const CheckConnection = ({ children }: { children: React.ReactNode }) => {
const { connectionStatus } = useAuthContext()
if (!connectionStatus) {
- postMessageParentDashboard({ type: 'header.actionsMenu', items: [] })
- postMessageParentDashboard({ type: 'header.primaryCta' })
- return
- } //remove app bridge functionality when app is disconnected.
+ return (
+
+
{!connectionStatus ? (
-
-
+
{
+ window.open(`${authInitUrl}${user.token}`, '_blank', 'noopener,noreferrer')
+ },
+ }}
+ />
) : null}
)
diff --git a/src/features/sync/components/Overlay.tsx b/src/features/sync/components/Overlay.tsx
new file mode 100644
index 0000000..754adef
--- /dev/null
+++ b/src/features/sync/components/Overlay.tsx
@@ -0,0 +1,5 @@
+'use client'
+
+export const Overlay = () => {
+ return
+}
diff --git a/src/features/sync/hooks/useFolder.ts b/src/features/sync/hooks/useFolder.ts
index 8402441..efe64ba 100644
--- a/src/features/sync/hooks/useFolder.ts
+++ b/src/features/sync/hooks/useFolder.ts
@@ -3,11 +3,15 @@ import { useAuthContext } from '@/features/auth/hooks/useAuth'
import type { Folder } from '@/features/sync/types'
export const useFolder = () => {
- const { user } = useAuthContext()
+ const { user, connectionStatus } = useAuthContext()
const [folderTree, setFolderTree] = useState
([])
const [isFolderTreeLoading, setIsFolderTreeLoading] = useState(true)
const getPathOptions = useCallback(async () => {
+ if (!connectionStatus) {
+ setIsFolderTreeLoading(false)
+ return
+ }
setIsFolderTreeLoading(true)
// api call to get all the folders
const response = await fetch(`/api/dropbox/folder-tree?token=${user.token}`, {
@@ -19,7 +23,7 @@ export const useFolder = () => {
const resp = await response.json()
setFolderTree(resp.folders)
setIsFolderTreeLoading(false)
- }, [user.token])
+ }, [user.token, connectionStatus])
useEffect(() => {
// biome-ignore lint/nursery/noFloatingPromises: floating promises are fine here