Skip to content

Commit 09de339

Browse files
committed
avoid the initial flickering
1 parent 1624b5d commit 09de339

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
141141
__resourceType: null,
142142
__noResourcesFound: null,
143143

144-
__evaluateNoResourcesFoundLabel: function(cards) {
144+
__evaluateNoResourcesFoundLabel: function() {
145145
if (this.__noResourcesFound) {
146146
let text = null;
147147
switch (this.__resourceType) {
@@ -177,7 +177,7 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
177177

178178
this.__noResourcesFound.set({
179179
value: text,
180-
visibility: text && cards.length === 0 ? "visible" : "excluded",
180+
visibility: text && this.__resourcesList.length === 0 ? "visible" : "excluded",
181181
});
182182
}
183183
},
@@ -323,7 +323,8 @@ qx.Class.define("osparc.dashboard.ResourceContainerManager", {
323323
setResourcesToList: function(resourcesList) {
324324
this.__resourcesList = resourcesList;
325325

326-
this.__evaluateNoResourcesFoundLabel(resourcesList);
326+
// delay it a bit to avoid the initial flickering
327+
setTimeout(() => this.__evaluateNoResourcesFoundLabel(), 1000);
327328
},
328329

329330
__cleanAll: function() {

0 commit comments

Comments
 (0)