@@ -102,7 +102,7 @@ type MaybeConnectedDeployment = {
102
102
deployment ?: ConnectedDeployment ;
103
103
deploymentName ?: string ;
104
104
loading : boolean ;
105
- errorKind : "None" | "DoesNotExist" ;
105
+ errorKind : "None" | "DoesNotExist" | "NotConnected" ;
106
106
} ;
107
107
108
108
export const ConnectedDeploymentContext = createContext < {
@@ -345,6 +345,7 @@ function DeploymentWithConnectionState({
345
345
deployment : ConnectedDeployment ;
346
346
children : ReactNode ;
347
347
} ) {
348
+ const { isSelfHosted } = useContext ( DeploymentInfoContext ) ;
348
349
const { client, deploymentUrl, deploymentName } = deployment ;
349
350
const [ connectionState , setConnectionState ] = useState <
350
351
"Connected" | "Disconnected" | "LocalDeploymentMismatch" | null
@@ -403,9 +404,12 @@ function DeploymentWithConnectionState({
403
404
) ;
404
405
return (
405
406
< >
406
- { isDisconnected && deploymentName . startsWith ( "local-" ) ? (
407
- < LocalDeploymentDisconnectOverlay />
408
- ) : null }
407
+ { isDisconnected &&
408
+ ( deploymentName . startsWith ( "local-" ) ? (
409
+ < LocalDeploymentDisconnectOverlay />
410
+ ) : isSelfHosted ? (
411
+ < SelfHostedDisconnectOverlay deploymentUrl = { deploymentUrl } />
412
+ ) : null ) }
409
413
< ConnectedDeploymentContext . Provider value = { value } >
410
414
{ children }
411
415
</ ConnectedDeploymentContext . Provider >
@@ -421,8 +425,8 @@ function LocalDeploymentDisconnectOverlay() {
421
425
backdropFilter : "blur(0.5rem)" ,
422
426
} }
423
427
>
424
- < div className = "mt-[-3.5rem] max-w-[40rem] " >
425
- < h3 > You are disconnected from your local deployment! </ h3 >
428
+ < div className = "max-w-prose " >
429
+ < h3 className = "mb-4" > This local deployment is not online. </ h3 >
426
430
< p className = "mb-2" >
427
431
Check that < code className = "text-sm" > npx convex dev</ code > is running
428
432
successfully.
@@ -436,3 +440,29 @@ function LocalDeploymentDisconnectOverlay() {
436
440
</ div >
437
441
) ;
438
442
}
443
+
444
+ function SelfHostedDisconnectOverlay ( {
445
+ deploymentUrl,
446
+ } : {
447
+ deploymentUrl : string ;
448
+ } ) {
449
+ return (
450
+ < div
451
+ className = "absolute z-50 flex h-full w-full items-center justify-center"
452
+ style = { {
453
+ backdropFilter : "blur(0.5rem)" ,
454
+ } }
455
+ >
456
+ < div className = "max-w-prose" >
457
+ < h3 className = "mb-4" > This deployment is not online.</ h3 >
458
+ < p className = "mb-2" >
459
+ Check that your Convex server is running and accessible at{ " " }
460
+ < code className = "text-sm" > { deploymentUrl } </ code > .
461
+ </ p >
462
+ < p >
463
+ If you continue to have issues, try restarting your Convex server.
464
+ </ p >
465
+ </ div >
466
+ </ div >
467
+ ) ;
468
+ }
0 commit comments