fix: overalpping guacd ui

This commit is contained in:
LukeGus
2026-05-22 00:14:33 -05:00
parent a9f82a5a45
commit b82111c273
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -30,3 +30,4 @@ dist-ssr
electron/build-info.cjs
/.mcp.json
/CLAUDE.md
/old_db/
@@ -65,6 +65,7 @@ export const GuacamoleDisplay = forwardRef<
typeof document === "undefined" ? true : document.hasFocus(),
);
const [isReady, setIsReady] = useState(false);
const [hasError, setHasError] = useState(false);
useImperativeHandle(ref, () => ({
disconnect: () => {
@@ -267,6 +268,7 @@ export const GuacamoleDisplay = forwardRef<
if (isConnectingRef.current) return;
isConnectingRef.current = true;
setIsReady(false);
setHasError(false);
// Wait two frames so the container is fully laid out before measuring.
await new Promise<void>((resolve) =>
@@ -386,6 +388,7 @@ export const GuacamoleDisplay = forwardRef<
client.onerror = (error: Guacamole.Status) => {
const errorMessage = error.message || t("guacamole.connectionError");
setIsReady(false);
setHasError(true);
isConnectingRef.current = false;
onError?.(errorMessage);
};
@@ -583,7 +586,10 @@ export const GuacamoleDisplay = forwardRef<
}}
/>
<SimpleLoader visible={!isReady} message={connectingMessage} />
<SimpleLoader
visible={!isReady && !hasError}
message={connectingMessage}
/>
</div>
);
});