@@ -55,27 +55,31 @@ function TerminalSidebar({ shell, showCheatsheet, ...props }: any) {
5555 const [ isModalOpen , setIsModalOpen ] = useState ( false )
5656 const [ stepIndex , setStepIndex ] = useState ( 0 )
5757 const {
58- workingSteps, skipConsoleInstall, appCount, stackName,
58+ workingSteps,
59+ skipConsoleInstall,
60+ displayConsoleButton,
61+ appCount,
62+ stackName,
5963 } = useMemo ( ( ) => {
6064 const workingSteps = [ ...steps ]
61- const shouldInstallConsole = retrieveConsole ( )
6265 const applications = retrieveApplications ( )
6366 const stack = retrieveStack ( )
67+ const shouldInstallConsole = retrieveConsole ( )
68+ const hasApplicationConsole = applications . some ( a => a . name === 'console' )
6469
6570 const ret = {
6671 appCount : applications ?. length ,
6772 stackName : stack ?. name ,
6873 workingSteps,
74+ skipConsoleInstall : ! shouldInstallConsole || hasApplicationConsole ,
75+ displayConsoleButton : shouldInstallConsole || hasApplicationConsole ,
6976 }
7077
71- if ( applications . length === 1 && applications [ 0 ] . name !== 'console' ) return { ...ret , skipConsoleInstall : false }
72- if ( shouldInstallConsole ) return { ...ret , skipConsoleInstall : false }
73-
74- ret . workingSteps . shift ( )
75-
76- return {
77- ...ret , skipConsoleInstall : true ,
78+ if ( ret . skipConsoleInstall ) {
79+ ret . workingSteps . shift ( )
7880 }
81+
82+ return ret
7983 } , [ ] )
8084
8185 const { title, Component } = workingSteps [ stepIndex ]
@@ -201,7 +205,7 @@ function TerminalSidebar({ shell, showCheatsheet, ...props }: any) {
201205 < OnboardingCompletionModal
202206 open = { isModalOpen }
203207 onClose = { ( ) => setIsModalOpen ( false ) }
204- skipConsoleInstall = { skipConsoleInstall }
208+ displayConsoleButton = { displayConsoleButton }
205209 shell = { shell }
206210 />
207211 </ >
0 commit comments