File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
services/static-webserver/client/source/class/osparc/store Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -385,16 +385,20 @@ qx.Class.define("osparc.store.Store", {
385385 } ,
386386
387387 __applyWallets : function ( wallets ) {
388+ console . log ( "wallets" , wallets ) ;
389+
388390 const preferenceSettings = osparc . Preferences . getInstance ( ) ;
389- const preferenceWalletId = preferenceSettings . getPreferredWalletId ( ) ;
391+ const defaultWalletId = preferenceSettings . getPreferredWalletId ( ) ;
390392 if (
391- ( preferenceWalletId === null || osparc . desktop . credits . Utils . getWallet ( preferenceWalletId ) === null ) &&
392- wallets . length === 1
393+ ( defaultWalletId === null || osparc . desktop . credits . Utils . getWallet ( defaultWalletId ) === null ) &&
394+ wallets . length
393395 ) {
394- // If there is only one wallet available, make it default
396+ // If there is no default wallet set in preferences or the default wallet is not available anymore:
397+ // select the personal wallet if it exists
398+ // wallets = wallets.filter(wallet => wallet.getType() === "personal");
395399 preferenceSettings . requestChangePreferredWalletId ( wallets [ 0 ] . getWalletId ( ) ) ;
396- } else if ( preferenceWalletId ) {
397- const walletFound = wallets . find ( wallet => wallet . getWalletId ( ) === preferenceWalletId ) ;
400+ } else if ( defaultWalletId ) {
401+ const walletFound = wallets . find ( wallet => wallet . getWalletId ( ) === defaultWalletId ) ;
398402 if ( walletFound ) {
399403 this . setPreferredWallet ( walletFound ) ;
400404 }
You can’t perform that action at this time.
0 commit comments