Skip to content

Commit 5c179c4

Browse files
committed
existsBuild
1 parent a04b8b3 commit 5c179c4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

services/static-webserver/client/source/class/osparc/wrapper/RocketPreview.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ qx.Class.define("osparc.wrapper.RocketPreview", {
4242
},
4343

4444
statics: {
45+
INDEX_HTML: "rocketPreview/build/index.html",
46+
47+
/**
48+
* Returns true if the RocketPreview build folder is available as a resource.
49+
*/
50+
existsBuild: function() {
51+
const rm = qx.util.ResourceManager.getInstance();
52+
// index.html is a good proxy for the whole build
53+
const resourceId = this.INDEX_HTML;
54+
return rm.has(resourceId);
55+
},
56+
4557
openWindow: function() {
4658
const win = new osparc.ui.window.Window();
4759
win.set({
@@ -85,7 +97,7 @@ qx.Class.define("osparc.wrapper.RocketPreview", {
8597
let control;
8698
switch (id) {
8799
case "iframe":
88-
const src = qx.util.ResourceManager.getInstance().toUri("rocketPreview/build/index.html");
100+
const src = qx.util.ResourceManager.getInstance().toUri(this.self().INDEX_HTML);
89101
control = new qx.ui.embed.Html("<iframe></iframe>");
90102
control.set({
91103
allowGrowX: true,

0 commit comments

Comments
 (0)