File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
services/static-webserver/client/source/class/osparc/store Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -349,10 +349,15 @@ qx.Class.define("osparc.store.Services", {
349349 } ,
350350
351351 getPricingPlan : function ( serviceKey , serviceVersion ) {
352- const serviceUrl = osparc . data . Resources . getServiceUrl ( serviceKey , serviceVersion )
352+ const serviceUrl = osparc . data . Resources . getServiceUrl ( serviceKey , serviceVersion ) ;
353+ const key = serviceUrl [ "key" ] ;
354+ const version = serviceUrl [ "version" ] ;
353355 // check if the service is already cached
354- if ( serviceUrl in this . __pricingPlansCached ) {
355- return Promise . resolve ( this . __pricingPlansCached [ serviceUrl ] ) ;
356+ if (
357+ key in this . __pricingPlansCached &&
358+ version in this . __pricingPlansCached [ key ]
359+ ) {
360+ return Promise . resolve ( this . __pricingPlansCached [ key ] [ version ] ) ;
356361 }
357362
358363 const plansParams = {
@@ -361,7 +366,10 @@ qx.Class.define("osparc.store.Services", {
361366 return osparc . data . Resources . fetch ( "services" , "pricingPlans" , plansParams )
362367 . then ( pricingPlansData => {
363368 // store the fetched pricing plans in the cache
364- this . __pricingPlansCached [ serviceUrl ] = pricingPlansData ;
369+ if ( ! ( key in this . __pricingPlansCached ) ) {
370+ this . __pricingPlansCached [ key ] = { } ;
371+ }
372+ this . __pricingPlansCached [ key ] [ version ] = pricingPlansData ;
365373 return pricingPlansData ;
366374 } ) ;
367375 } ,
You can’t perform that action at this time.
0 commit comments