File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
services/static-webserver/client/source/class/osparc/store Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -389,10 +389,18 @@ qx.Class.define("osparc.store.Store", {
389389 const preferenceWalletId = preferenceSettings . getPreferredWalletId ( ) ;
390390 if (
391391 ( preferenceWalletId === null || osparc . desktop . credits . Utils . getWallet ( preferenceWalletId ) === null ) &&
392- wallets . length === 1
392+ wallets . length
393393 ) {
394- // If there is only one wallet available, make it default
395- preferenceSettings . requestChangePreferredWalletId ( wallets [ 0 ] . getWalletId ( ) ) ;
394+ // If there is no default wallet set in preferences or the default wallet is not available anymore:
395+ const myGroupId = osparc . auth . Data . getInstance ( ) . getGroupId ( ) ;
396+ const myWallet = wallets . find ( wallet => wallet . getOwner ( ) === myGroupId ) ;
397+ if ( myWallet ) {
398+ // select the personal wallet if it exists
399+ preferenceSettings . requestChangePreferredWalletId ( myWallet . getWalletId ( ) ) ;
400+ } else {
401+ // otherwise select the first wallet available
402+ preferenceSettings . requestChangePreferredWalletId ( wallets [ 0 ] . getWalletId ( ) ) ;
403+ }
396404 } else if ( preferenceWalletId ) {
397405 const walletFound = wallets . find ( wallet => wallet . getWalletId ( ) === preferenceWalletId ) ;
398406 if ( walletFound ) {
You can’t perform that action at this time.
0 commit comments