@@ -137,7 +137,8 @@ qx.Class.define("osparc.dashboard.TemplateBrowser", {
137137 return ;
138138 }
139139
140- this . _showLoadingPage ( this . tr ( "Creating " ) + ( templateData . name || osparc . product . Utils . getStudyAlias ( { firstUpperCase : true } ) ) ) ;
140+ const studyAlias = osparc . product . Utils . getStudyAlias ( { firstUpperCase : true } ) ;
141+ this . _showLoadingPage ( this . tr ( "Creating " ) + ( templateData . name || studyAlias ) ) ;
141142
142143 const studyOptions = new osparc . study . StudyOptions ( ) ;
143144 // they will be patched once the study is created
@@ -152,10 +153,11 @@ qx.Class.define("osparc.dashboard.TemplateBrowser", {
152153 win . addListener ( "cancel" , ( ) => cancelStudyOptions ( ) ) ;
153154 studyOptions . addListener ( "cancel" , ( ) => cancelStudyOptions ( ) ) ;
154155 studyOptions . addListener ( "startStudy" , ( ) => {
155- const titleSelection = studyOptions . getChildControl ( "title-field" ) . getValue ( ) ;
156+ const newName = studyOptions . getChildControl ( "title-field" ) . getValue ( ) ;
156157 const walletSelection = studyOptions . getChildControl ( "wallet-selector" ) . getSelection ( ) ;
157158 const nodesPricingUnits = studyOptions . getChildControl ( "study-pricing-units" ) . getNodePricingUnits ( ) ;
158159 win . close ( ) ;
160+ this . _showLoadingPage ( this . tr ( "Creating " ) + ( newName || studyAlias ) ) ;
159161 osparc . study . Utils . createStudyFromTemplate ( templateData , this . _loadingPage )
160162 . then ( newStudyData => {
161163 const studyId = newStudyData [ "uuid" ] ;
@@ -174,8 +176,8 @@ qx.Class.define("osparc.dashboard.TemplateBrowser", {
174176
175177 const promises = [ ] ;
176178 // patch the name
177- if ( newStudyData [ "name" ] !== titleSelection ) {
178- promises . push ( osparc . study . StudyOptions . updateName ( newStudyData , titleSelection ) ) ;
179+ if ( newStudyData [ "name" ] !== newName ) {
180+ promises . push ( osparc . study . StudyOptions . updateName ( newStudyData , newName ) ) ;
179181 }
180182 // patch the wallet
181183 if ( walletSelection . length && walletSelection [ 0 ] [ "walletId" ] ) {
0 commit comments