fix: 🐛 handle empty SSH_SERVER_PORT with quick command button #470

This commit is contained in:
Ravinou 2025-06-01 12:28:04 +02:00
commit 88c8f920d9
No known key found for this signature in database
GPG key ID: EEEE670C40F6A4D7

View file

@ -22,7 +22,7 @@ export default function QuickCommands(props: QuickCommandsProps) {
// Asynchronously call copy to clipboard
navigator.clipboard
.writeText(
`ssh://${wizardEnv?.UNIX_USER}@${FQDN}${SSH_SERVER_PORT}/./${props.repositoryName}`
`ssh://${wizardEnv?.UNIX_USER}@${FQDN}${SSH_SERVER_PORT ? SSH_SERVER_PORT : ''}/./${props.repositoryName}`
)
.then(() => {
setIsCopied(true);
@ -42,7 +42,7 @@ export default function QuickCommands(props: QuickCommandsProps) {
) : (
<div className={classes.tooltip}>
ssh://{wizardEnv?.UNIX_USER}@{FQDN}
{SSH_SERVER_PORT}/./
{SSH_SERVER_PORT ? SSH_SERVER_PORT : ''}/./
{props.repositoryName}
</div>
)}