fix: don't show wsh error for a connection error (#1438)

This commit is contained in:
Sylvie Crowe 2024-12-09 15:18:58 -08:00 committed by GitHub
parent 6a3f72830b
commit 43c134ea9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -186,10 +186,7 @@ const BlockFrame_Header = ({
const dragHandleRef = preview ? null : nodeModel.dragHandleRef;
const connName = blockData?.meta?.connection;
const connStatus = util.useAtomValueSafe(getConnStatusAtom(connName));
const wshEnabled =
(connName &&
(connStatus?.status == "connecting" || (connStatus?.wshenabled && connStatus?.status == "connected"))) ??
true;
const wshProblem = connName && !connStatus?.wshenabled && connStatus?.status == "connected";
React.useEffect(() => {
if (!magnified || preview || prevMagifiedState.current) {
@ -269,7 +266,7 @@ const BlockFrame_Header = ({
changeConnModalAtom={changeConnModalAtom}
/>
)}
{manageConnection && !wshEnabled && (
{manageConnection && wshProblem && (
<IconButton decl={wshInstallButton} className="block-frame-header-iconbutton" />
)}
<div className="block-frame-textelems-wrapper">{headerTextElems}</div>