Prevent terminal being created twice (#10200)

I missed this in code review.
This commit is contained in:
Asher
2023-10-11 12:47:32 -08:00
committed by GitHub
parent 301c045aad
commit a67a5a8105

View File

@ -154,7 +154,7 @@ const TerminalPage: FC = () => {
// Create the terminal!
useEffect(() => {
if (!xtermRef.current) {
if (!xtermRef.current || config.isLoading) {
return;
}
const terminal = new XTerm.Terminal({
@ -210,7 +210,7 @@ const TerminalPage: FC = () => {
window.removeEventListener("resize", listener);
terminal.dispose();
};
}, [config.data, sendEvent, xtermRef, handleWebLink]);
}, [config.data, config.isLoading, sendEvent, xtermRef, handleWebLink]);
// Triggers the initial terminal connection using
// the reconnection token and workspace name found