File tree Expand file tree Collapse file tree 2 files changed +23
-10
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -94,18 +94,24 @@ qx.Class.define("osparc.conversation.MessageList", {
9494 this . getChildControl ( "add-message" ) ;
9595 } ,
9696
97- _applyConversation : function ( conversation ) {
97+ _applyConversation : function ( conversation , oldConversation ) {
9898 this . __reloadMessages ( true ) ;
9999
100+ const messageAdded = e => {
101+ const data = e . getData ( ) ;
102+ this . _messageAdded ( data ) ;
103+ } ;
104+ const messageDeleted = e => {
105+ const data = e . getData ( ) ;
106+ this . __messageDeleted ( data ) ;
107+ } ;
100108 if ( conversation ) {
101- conversation . addListener ( "messageAdded" , e => {
102- const data = e . getData ( ) ;
103- this . _messageAdded ( data ) ;
104- } ) ;
105- conversation . addListener ( "messageDeleted" , e => {
106- const data = e . getData ( ) ;
107- this . __messageDeleted ( data ) ;
108- } ) ;
109+ conversation . addListener ( "messageAdded" , messageAdded ) ;
110+ conversation . addListener ( "messageDeleted" , messageDeleted ) ;
111+ }
112+ if ( oldConversation ) {
113+ oldConversation . removeListener ( "messageAdded" , messageAdded ) ;
114+ oldConversation . removeListener ( "messageDeleted" , messageDeleted ) ;
109115 }
110116 } ,
111117
Original file line number Diff line number Diff line change @@ -267,7 +267,14 @@ qx.Class.define("osparc.support.ConversationPage", {
267267 this . getChildControl ( "rename-conversation-button" ) ;
268268
269269 const openProjectButton = this . getChildControl ( "open-project-button" ) ;
270- openProjectButton . setVisibility ( conversation && conversation . getContextProjectId ( ) ? "visible" : "excluded" ) ;
270+ if ( conversation && conversation . getContextProjectId ( ) ) {
271+ openProjectButton . setVisibility ( "visible" ) ;
272+ osparc . store . Study . getInstance ( ) . getOne ( conversation . getContextProjectId ( ) )
273+ . then ( ( ) => openProjectButton . setEnabled ( true ) )
274+ . catch ( ( ) => openProjectButton . setEnabled ( false ) ) ;
275+ } else {
276+ openProjectButton . setVisibility ( "excluded" ) ;
277+ }
271278
272279 this . getChildControl ( "copy-ticket-id-button" ) ;
273280
You can’t perform that action at this time.
0 commit comments