Skip to content

Commit 07a164d

Browse files
committed
simplify
1 parent ab1ba4f commit 07a164d

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

services/static-webserver/client/source/class/osparc/desktop/organizations/MembersList.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
310310
}
311311

312312
const groupsStore = osparc.store.Groups.getInstance();
313-
const productEveryone = await groupsStore.getProductEveryone();
314-
313+
const productEveryone = groupsStore.getEveryoneProductGroup();
315314
const orgId = this.__currentOrg.getGid();
316315
const params = {
317316
url: {

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -140,24 +140,6 @@ qx.Class.define("osparc.store.Groups", {
140140
return Object.keys(this.getOrganizations());
141141
},
142142

143-
__getGroups: function(group) {
144-
return new Promise(resolve => {
145-
osparc.data.Resources.get("organizations")
146-
.then(groups => {
147-
resolve(groups[group]);
148-
})
149-
.catch(err => console.error(err));
150-
});
151-
},
152-
153-
getProductEveryone: function() {
154-
return this.__getGroups("product");
155-
},
156-
157-
getGroupEveryone: function() {
158-
return this.__getGroups("all");
159-
},
160-
161143
__getAllGroups: function() {
162144
return new Promise(resolve => {
163145
const promises = [];

services/static-webserver/client/source/class/osparc/ui/list/OrganizationListItem.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,10 @@ qx.Class.define("osparc.ui.list.OrganizationListItem", {
8484
}
8585
if (this.isPropertyInitialized("key")) {
8686
const groupsStore = osparc.store.Groups.getInstance();
87-
groupsStore.getProductEveryone()
88-
.then(groupProductEveryone => {
89-
if (groupProductEveryone && parseInt(this.getKey()) === groupProductEveryone["gid"]) {
90-
thumbnail.setSource(osparc.utils.Icons.everyone(osparc.ui.list.ListItemWithMenu.ICON_SIZE));
91-
}
92-
});
87+
const groupProductEveryone = groupsStore.getEveryoneProductGroup();
88+
if (groupProductEveryone && parseInt(this.getKey()) === groupProductEveryone.getGroupId()) {
89+
thumbnail.setSource(osparc.utils.Icons.everyone(osparc.ui.list.ListItemWithMenu.ICON_SIZE));
90+
}
9391
}
9492
}
9593
}

0 commit comments

Comments
 (0)