@@ -89,12 +89,12 @@ qx.Class.define("osparc.FlashMessenger", {
8989 const flashMessage = this . getInstance ( ) . logAs ( msg , "ERROR" , duration ) ;
9090 error [ "supportId" ] = "1234" ;
9191 if ( error && error [ "supportId" ] ) {
92- flashMessage . addWidget ( this . self ( ) . createCopyEOCWidget ( error [ "supportId" ] ) ) ;
92+ flashMessage . addWidget ( this . __createCopyEOCWidget ( flashMessage , error [ "supportId" ] ) ) ;
9393 }
9494 return flashMessage ;
9595 } ,
9696
97- createCopyEOCWidget : function ( supportId ) {
97+ __createCopyEOCWidget : function ( flashMessage , supportId ) {
9898 const widget = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( ) ) . set ( {
9999 paddingLeft : 10
100100 } ) ;
@@ -123,6 +123,12 @@ qx.Class.define("osparc.FlashMessenger", {
123123 showErrorLabel . exclude ( ) ;
124124 hideErrorLabel . show ( ) ;
125125 errorLabel . show ( ) ;
126+
127+ if ( flashMessage . timer ) {
128+ // let the user close it
129+ clearTimeout ( flashMessage . timer ) ;
130+ delete flashMessage . timer ;
131+ }
126132 } ) ;
127133 hideErrorLabel . addListener ( "tap" , ( ) => {
128134 hideErrorLabel . exclude ( ) ;
@@ -189,7 +195,7 @@ qx.Class.define("osparc.FlashMessenger", {
189195
190196 const duration = flashMessage . getDuration ( ) ;
191197 if ( duration !== 0 ) {
192- qx . event . Timer . once ( ( ) => this . removeMessage ( flashMessage ) , this , duration ) ;
198+ flashMessage . timer = setTimeout ( ( ) => this . removeMessage ( flashMessage ) , duration ) ;
193199 }
194200 } ,
195201
0 commit comments