@@ -135,7 +135,8 @@ qx.Class.define("osparc.Application", {
135135 osparc . auth . Manager . getInstance ( ) . validateToken ( )
136136 . then ( ( ) => {
137137 const studyId = urlFragment . nav [ 1 ] ;
138- this . __loadMainPage ( studyId ) ;
138+ const loadAfterLogin = { studyId } ;
139+ this . __loadMainPage ( loadAfterLogin ) ;
139140 } )
140141 . catch ( ( ) => this . __loadLoginPage ( ) ) ;
141142 }
@@ -153,12 +154,31 @@ qx.Class.define("osparc.Application", {
153154 if ( [ "anonymous" , "guest" ] . includes ( data . role . toLowerCase ( ) ) ) {
154155 this . __loadNodeViewerPage ( studyId , viewerNodeId ) ;
155156 } else {
156- this . __loadMainPage ( studyId ) ;
157+ const loadAfterLogin = { studyId } ;
158+ this . __loadMainPage ( loadAfterLogin ) ;
157159 }
158160 } ) ;
159161 }
160162 break ;
161163 }
164+ case "conversation" : {
165+ // Route: /#/conversation/{id}
166+ if ( urlFragment . nav . length > 1 ) {
167+ osparc . utils . Utils . cookie . deleteCookie ( "user" ) ;
168+ osparc . auth . Manager . getInstance ( ) . validateToken ( )
169+ . then ( ( ) => {
170+ const conversationId = urlFragment . nav [ 1 ] ;
171+ const loadAfterLogin = { conversationId } ;
172+ this . __loadMainPage ( loadAfterLogin ) ;
173+ } )
174+ . catch ( ( ) => this . __loadLoginPage ( ) ) ;
175+ }
176+ if ( urlFragment . nav && urlFragment . nav . length > 1 ) {
177+ const conversationId = urlFragment . nav [ 1 ] ;
178+ this . __loadConversationPage ( conversationId ) ;
179+ }
180+ break ;
181+ }
162182 case "registration" : {
163183 // Route: /#/registration/?invitation={token}
164184 if ( urlFragment . params && urlFragment . params . invitation ) {
@@ -201,9 +221,9 @@ qx.Class.define("osparc.Application", {
201221 }
202222 break ;
203223 }
204- case "form-sandbox" : {
224+ case "form-sandbox" :
205225 this . __loadView ( new osparc . desktop . FormSandboxPage ( ) , { } , false ) ;
206- }
226+ break ;
207227 }
208228 } ,
209229
@@ -450,7 +470,7 @@ qx.Class.define("osparc.Application", {
450470 view . addListener ( "done" , ( ) => this . __restart ( ) , this ) ;
451471 } ,
452472
453- __loadMainPage : function ( studyId = null ) {
473+ __loadMainPage : function ( loadAfterLogin = null ) {
454474 // logged in
455475 osparc . WindowSizeTracker . getInstance ( ) . evaluateTooSmallDialog ( ) ;
456476 osparc . data . Resources . getOne ( "profile" )
@@ -497,10 +517,18 @@ qx.Class.define("osparc.Application", {
497517 } ) ;
498518 }
499519
500- if ( studyId ) {
520+ if ( loadAfterLogin && loadAfterLogin [ "studyId" ] ) {
521+ const studyId = loadAfterLogin [ "studyId" ] ;
501522 osparc . store . Store . getInstance ( ) . setCurrentStudyId ( studyId ) ;
502523 }
503524
525+ if ( loadAfterLogin && loadAfterLogin [ "conversationId" ] ) {
526+ const conversationId = loadAfterLogin [ "conversationId" ] ;
527+ const supportCenterWindow = osparc . support . SupportCenter . openWindow ( ) ;
528+ supportCenterWindow . openConversation ( conversationId ) ;
529+ this . __loadConversationPage ( conversationId ) ;
530+ }
531+
504532 const loadViewerPage = ( ) => {
505533 const mainPage = new osparc . desktop . MainPage ( ) ;
506534 this . __mainPage = mainPage ;
0 commit comments