Skip to content

fix: prevent duplicated creation of terminal #10200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prevent terminal being created twice
I missed this in code review.
  • Loading branch information
code-asher committed Oct 11, 2023
commit f9e06b7ced8dc1af1ab7e0d05bd487be6beaf1f2
4 changes: 2 additions & 2 deletions site/src/pages/TerminalPage/TerminalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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
Expand Down