File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
services/static-webserver/client/source/class/osparc/widget Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -198,18 +198,21 @@ qx.Class.define("osparc.widget.NodeOutputs", {
198198 valueWidget = new osparc . ui . basic . LinkLabel ( ) ;
199199 if ( "store" in value ) {
200200 // it's a file
201- const download = true ;
202- const locationId = value . store ;
203- const fileId = value . path ;
204201 const filename = value . filename || osparc . file . FilePicker . getFilenameFromPath ( value ) ;
205202 valueWidget . setValue ( filename ) ;
206203 valueWidget . eTag = value [ "eTag" ] ;
207- osparc . store . Data . getInstance ( ) . getPresignedLink ( download , locationId , fileId )
208- . then ( presignedLinkData => {
209- if ( "resp" in presignedLinkData && presignedLinkData . resp ) {
210- valueWidget . setUrl ( presignedLinkData . resp . link ) ;
211- }
212- } ) ;
204+ const download = true ;
205+ const locationId = value . store ;
206+ const fileId = value . path ;
207+ // request the presigned link only when the widget is shown
208+ valueWidget . addListenerOnce ( "appear" , ( ) => {
209+ osparc . store . Data . getInstance ( ) . getPresignedLink ( download , locationId , fileId )
210+ . then ( presignedLinkData => {
211+ if ( "resp" in presignedLinkData && presignedLinkData . resp ) {
212+ valueWidget . setUrl ( presignedLinkData . resp . link ) ;
213+ }
214+ } ) ;
215+ } ) ;
213216 } else if ( "downloadLink" in value ) {
214217 // it's a link
215218 const filename = ( value . filename && value . filename . length > 0 ) ? value . filename : osparc . file . FileDownloadLink . extractLabelFromLink ( value [ "downloadLink" ] ) ;
You can’t perform that action at this time.
0 commit comments