Skip to content

Commit cf6c864

Browse files
committed
improved UX
1 parent 8b66060 commit cf6c864

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

services/static-webserver/client/source/class/osparc/dashboard/ResourceContainerManager.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
140140
__groupedContainers: null,
141141
__resourceType: null,
142142
__noResourcesFound: null,
143+
__noResourcesFoundTimer: null,
143144

144145
__evaluateNoResourcesFoundLabel: function() {
145146
let text = null;
@@ -174,10 +175,19 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
174175
break;
175176
}
176177

177-
this.__noResourcesFound.set({
178-
value: text,
179-
visibility: text && this.__resourcesList.length === 0 ? "visible" : "excluded",
180-
});
178+
this.__noResourcesFound.exclude();
179+
if (this.__noResourcesFoundTimer) {
180+
clearTimeout(this.__noResourcesFoundTimer);
181+
}
182+
if (text && this.__resourcesList.length === 0) {
183+
// delay it a bit to avoid the initial flickering
184+
this.__noResourcesFoundTimer = setTimeout(() => {
185+
this.__noResourcesFound.set({
186+
value: text,
187+
visibility: "visible",
188+
});
189+
}, 2000);
190+
}
181191
},
182192

183193
addNonResourceCard: function(card) {
@@ -321,8 +331,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
321331
setResourcesToList: function(resourcesList) {
322332
this.__resourcesList = resourcesList;
323333

324-
// delay it a bit to avoid the initial flickering
325-
setTimeout(() => this.__evaluateNoResourcesFoundLabel(), 1000);
334+
this.__evaluateNoResourcesFoundLabel();
326335
},
327336

328337
__cleanAll: function() {

0 commit comments

Comments
 (0)