@@ -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,27 @@ 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+           break ; 
177+         } 
162178        case  "registration" : { 
163179          // Route: /#/registration/?invitation={token} 
164180          if  ( urlFragment . params  &&  urlFragment . params . invitation )  { 
@@ -201,9 +217,9 @@ qx.Class.define("osparc.Application", {
201217          } 
202218          break ; 
203219        } 
204-         case  "form-sandbox" :  { 
220+         case  "form-sandbox" :
205221          this . __loadView ( new  osparc . desktop . FormSandboxPage ( ) ,  { } ,  false ) ; 
206-         } 
222+            break ; 
207223      } 
208224    } , 
209225
@@ -450,7 +466,7 @@ qx.Class.define("osparc.Application", {
450466      view . addListener ( "done" ,  ( )  =>  this . __restart ( ) ,  this ) ; 
451467    } , 
452468
453-     __loadMainPage : function ( studyId  =  null )  { 
469+     __loadMainPage : function ( loadAfterLogin  =  null )  { 
454470      // logged in 
455471      osparc . WindowSizeTracker . getInstance ( ) . evaluateTooSmallDialog ( ) ; 
456472      osparc . data . Resources . getOne ( "profile" ) 
@@ -497,10 +513,17 @@ qx.Class.define("osparc.Application", {
497513              } ) ; 
498514            } 
499515
500-             if  ( studyId )  { 
516+             if  ( loadAfterLogin  &&  loadAfterLogin [ "studyId" ] )  { 
517+               const  studyId  =  loadAfterLogin [ "studyId" ] ; 
501518              osparc . store . Store . getInstance ( ) . setCurrentStudyId ( studyId ) ; 
502519            } 
503520
521+             if  ( loadAfterLogin  &&  loadAfterLogin [ "conversationId" ] )  { 
522+               const  conversationId  =  loadAfterLogin [ "conversationId" ] ; 
523+               const  supportCenterWindow  =  osparc . support . SupportCenter . openWindow ( ) ; 
524+               supportCenterWindow . openConversation ( conversationId ) ; 
525+             } 
526+ 
504527            const  loadViewerPage  =  ( )  =>  { 
505528              const  mainPage  =  new  osparc . desktop . MainPage ( ) ; 
506529              this . __mainPage  =  mainPage ; 
0 commit comments