Skip to content

Commit 0ab503d

Browse files
committed
comments
1 parent f98ad3a commit 0ab503d

File tree

1 file changed

+10
-6
lines changed
  • services/static-webserver/client/source/class/osparc/store

1 file changed

+10
-6
lines changed

services/static-webserver/client/source/class/osparc/store/Store.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)