refactor: code cleanup

This commit is contained in:
UndefinedPony
2024-12-22 19:01:02 +01:00
parent fd0a9b8b58
commit 228d12a61c
4 changed files with 10 additions and 12 deletions
@@ -66,7 +66,7 @@ export const TerminalModal = ({ children, serverId }: Props) => {
)}
<div className="flex flex-col gap-4 h-[552px]">
<Terminal key={terminalKey} id="terminal" serverId={serverId} />
<Terminal id="terminal" key={terminalKey} serverId={serverId} />
</div>
</DialogContent>
</Dialog>
@@ -41,12 +41,10 @@ export const Terminal: React.FC<Props> = ({ id, serverId }) => {
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
const isLocalServer = serverId === "local";
const urlParams = new URLSearchParams();
urlParams.set("serverId", serverId);
if (isLocalServer) {
if (serverId === "local") {
const { port, username } = getLocalServerData();
urlParams.set("port", port.toString());
urlParams.set("username", username);