Skip to content

Commit a67a5a8

Browse files
authored
Prevent terminal being created twice (#10200)
I missed this in code review.
1 parent 301c045 commit a67a5a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

site/src/pages/TerminalPage/TerminalPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const TerminalPage: FC = () => {
154154

155155
// Create the terminal!
156156
useEffect(() => {
157-
if (!xtermRef.current) {
157+
if (!xtermRef.current || config.isLoading) {
158158
return;
159159
}
160160
const terminal = new XTerm.Terminal({
@@ -210,7 +210,7 @@ const TerminalPage: FC = () => {
210210
window.removeEventListener("resize", listener);
211211
terminal.dispose();
212212
};
213-
}, [config.data, sendEvent, xtermRef, handleWebLink]);
213+
}, [config.data, config.isLoading, sendEvent, xtermRef, handleWebLink]);
214214

215215
// Triggers the initial terminal connection using
216216
// the reconnection token and workspace name found

0 commit comments

Comments
 (0)