Skip to content

Commit b31555d

Browse files
committed
two options
1 parent 0ab503d commit b31555d

File tree

1 file changed

+9
-3
lines changed
  • services/static-webserver/client/source/class/osparc/store

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,15 @@ qx.Class.define("osparc.store.Store", {
394394
wallets.length
395395
) {
396396
// 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");
399-
preferenceSettings.requestChangePreferredWalletId(wallets[0].getWalletId());
397+
const myGroupId = osparc.auth.Data.getInstance().getGroupId();
398+
const myWallet = wallets.filter(wallet => wallet.getOwner() === myGroupId);
399+
if (myWallet) {
400+
// select the personal wallet if it exists
401+
preferenceSettings.requestChangePreferredWalletId(myWallet.getWalletId());
402+
} else {
403+
// otherwise select the first wallet available
404+
preferenceSettings.requestChangePreferredWalletId(wallets[0].getWalletId());
405+
}
400406
} else if (defaultWalletId) {
401407
const walletFound = wallets.find(wallet => wallet.getWalletId() === defaultWalletId);
402408
if (walletFound) {

0 commit comments

Comments
 (0)