Skip to content

Commit 24e19a8

Browse files
icecrasher321Vikhyath Mondreti
andauthored
add 6s timeout (#645)
Co-authored-by: Vikhyath Mondreti <[email protected]>
1 parent 4a26b06 commit 24e19a8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/sim/app/workspace/[workspaceId]/w/components/providers/workspace-permissions-provider.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ export function WorkspacePermissionsProvider({ children }: WorkspacePermissionsP
8787
}
8888
// If we were previously connected and this is a reconnection, stay offline (user must refresh)
8989
} else if (hasBeenConnected) {
90-
// Only enter offline mode if we were previously connected and now disconnected
91-
setIsOfflineMode(true)
90+
const timeoutId = setTimeout(() => {
91+
setIsOfflineMode(true)
92+
}, 6000)
93+
return () => clearTimeout(timeoutId)
9294
}
9395
// If not connected and never been connected, stay in initial state (not offline mode)
9496
}, [isConnected, hasBeenConnected])

0 commit comments

Comments
 (0)