diff --git a/webapp/packages/plugin-connections/src/ConnectionShield.tsx b/webapp/packages/plugin-connections/src/ConnectionShield.tsx index 8185e07aeb..4239b657dc 100644 --- a/webapp/packages/plugin-connections/src/ConnectionShield.tsx +++ b/webapp/packages/plugin-connections/src/ConnectionShield.tsx @@ -23,10 +23,11 @@ export const ConnectionShield = observer connectionKey && connection.resource.isConnecting(connectionKey)); + const connecting = getComputed(() => (connectionKey && connection.resource.isConnecting(connectionKey)) || connection.loading); + const isConnectionReady = getComputed(() => !connecting && connection.data?.connected && connection.loaded && !connection.outdated); async function handleConnect() { - if (connecting || !connection.data || !connectionKey) { + if (isConnectionReady || !connection.data || !connectionKey) { return; } @@ -37,11 +38,11 @@ export const ConnectionShield = observer connection.data && !connection.data.connected)) { - if (connecting) { - return ; - } + if (connecting) { + return ; + } + if (!isConnectionReady) { return (