File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
services/static-webserver/client/source/class/osparc/store Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ qx.Class.define("osparc.store.LicensedItems", {
2323 this . base ( arguments ) ;
2424
2525 this . __licensedItems = null ;
26+ this . __cachedLicensedItems = { } ;
2627 } ,
2728
2829 statics : {
@@ -94,6 +95,7 @@ qx.Class.define("osparc.store.LicensedItems", {
9495
9596 members : {
9697 __licensedItems : null ,
98+ __cachedLicensedItems : null ,
9799
98100 getLicensedItems : function ( ) {
99101 if ( this . __licensedItems ) {
@@ -102,11 +104,17 @@ qx.Class.define("osparc.store.LicensedItems", {
102104
103105 return osparc . data . Resources . getInstance ( ) . getAllPages ( "licensedItems" )
104106 . then ( licensedItems => {
107+ licensedItems . forEach ( licensedItemData => this . __addLicensedItemsToCache ( licensedItemData ) ) ;
105108 this . __licensedItems = licensedItems ;
106109 return this . __licensedItems ;
107110 } ) ;
108111 } ,
109112
113+ __addLicensedItemsToCache : function ( licensedItemData ) {
114+ const licensedItem = new osparc . data . model . LicensedItem ( licensedItemData ) ;
115+ this . __cachedLicensedItems [ licensedItem . getLicensedItemId ( ) ] = licensedItem ;
116+ } ,
117+
110118 getPurchasedLicensedItems : function ( walletId , urlParams , options = { } ) {
111119 let purchasesParams = {
112120 url : {
You can’t perform that action at this time.
0 commit comments