@@ -4,14 +4,12 @@ import { DvrRounded } from '@mui/icons-material';
44import { copyToClipboard } from './ContainerList' ;
55
66// copies the password to the clipboard, then opens the connectionURI
7- const openADS = ( connectionURI : string , saPassword : string ) => {
7+ const openURI = ( connectionURI : string , saPassword : string ) => {
88 copyToClipboard ( saPassword ) ;
9- window . location . href = connectionURI ;
10- }
11-
12- const openVSC = ( connectionURI : string , saPassword : string ) => {
13- copyToClipboard ( saPassword ) ;
14- window . location . href = connectionURI ;
9+ // wait 1 second
10+ setTimeout ( ( ) => {
11+ window . location . href = connectionURI ;
12+ } , 1000 ) ;
1513}
1614
1715export const ConnectionOptions = ( { container, trackEvent } ) => {
@@ -23,7 +21,7 @@ if (osName !== "Windows") {
2321 < IconButton size = "small" aria-label = 'connect' disabled = { ! ( container . Status === "running" ) }
2422 onClick = { ( ) => {
2523 trackEvent ( 'OpenADS' , { containerId : container . Id } ) ;
26- openADS ( container . adsConnectionURI ( ) , container . SApassword ) ;
24+ openURI ( container . adsConnectionURI ( ) , container . SApassword ) ;
2725 } } >
2826 < DvrRounded />
2927 </ IconButton >
@@ -32,7 +30,7 @@ if (osName !== "Windows") {
3230 < IconButton size = "small" aria-label = 'connect' disabled = { ! ( container . Status === "running" ) }
3331 onClick = { ( ) => {
3432 trackEvent ( 'OpenVSC' , { containerId : container . Id } ) ;
35- openVSC ( container . vscConnectionURI ( ) , container . SApassword ) ;
33+ openURI ( container . vscConnectionURI ( ) , container . SApassword ) ;
3634 } } >
3735 < DvrRounded />
3836 </ IconButton >
@@ -46,7 +44,7 @@ if (osName !== "Windows") {
4644 < IconButton size = "small" aria-label = 'connect' disabled = { ! ( container . Status === "running" ) }
4745 onClick = { ( ) => {
4846 trackEvent ( 'OpenADS' , { containerId : container . Id } ) ;
49- openADS ( container . adsConnectionURI ( ) , container . SApassword ) ;
47+ openURI ( container . adsConnectionURI ( ) , container . SApassword ) ;
5048 } } >
5149 < DvrRounded />
5250 </ IconButton >
@@ -55,7 +53,7 @@ if (osName !== "Windows") {
5553 < IconButton size = "small" aria-label = 'connect' disabled = { ! ( container . Status === "running" ) }
5654 onClick = { ( ) => {
5755 trackEvent ( 'OpenVSC' , { containerId : container . Id } ) ;
58- openVSC ( container . vscConnectionURI ( ) , container . SApassword ) ;
56+ openURI ( container . vscConnectionURI ( ) , container . SApassword ) ;
5957 } } >
6058 < DvrRounded />
6159 </ IconButton >
0 commit comments