freestyle-sandboxes 0.0.54 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -789,7 +789,7 @@ ${response.error.message}`);
789
789
  client: this.client,
790
790
  body: {
791
791
  // @ts-ignore
792
- repo: repo || repoUrl,
792
+ repo: repoUrl,
793
793
  repoId
794
794
  }
795
795
  });
package/dist/index.mjs CHANGED
@@ -787,7 +787,7 @@ ${response.error.message}`);
787
787
  client: this.client,
788
788
  body: {
789
789
  // @ts-ignore
790
- repo: repo || repoUrl,
790
+ repo: repoUrl,
791
791
  repoId
792
792
  }
793
793
  });
@@ -61,6 +61,7 @@ function FreestyleDevServerInner({
61
61
  }, 45 * 1e3);
62
62
  return () => clearInterval(interval);
63
63
  }, [data?.ephemeralUrl]);
64
+ const [wasLoaded, setWasLoaded] = React.useState(false);
64
65
  if (isLoading) {
65
66
  return loadingComponent({
66
67
  devCommandRunning: false,
@@ -68,13 +69,14 @@ function FreestyleDevServerInner({
68
69
  serverStarting: true
69
70
  });
70
71
  }
71
- if (!data?.devCommandRunning) {
72
+ if (!data?.devCommandRunning && !wasLoaded) {
72
73
  return loadingComponent({
73
74
  devCommandRunning: data?.devCommandRunning ?? false,
74
75
  installCommandRunning: data?.installCommandRunning ?? false,
75
76
  serverStarting: false
76
77
  });
77
78
  }
79
+ setWasLoaded(true);
78
80
  return /* @__PURE__ */ React.createElement(
79
81
  "iframe",
80
82
  {
@@ -59,6 +59,7 @@ function FreestyleDevServerInner({
59
59
  }, 45 * 1e3);
60
60
  return () => clearInterval(interval);
61
61
  }, [data?.ephemeralUrl]);
62
+ const [wasLoaded, setWasLoaded] = React.useState(false);
62
63
  if (isLoading) {
63
64
  return loadingComponent({
64
65
  devCommandRunning: false,
@@ -66,13 +67,14 @@ function FreestyleDevServerInner({
66
67
  serverStarting: true
67
68
  });
68
69
  }
69
- if (!data?.devCommandRunning) {
70
+ if (!data?.devCommandRunning && !wasLoaded) {
70
71
  return loadingComponent({
71
72
  devCommandRunning: data?.devCommandRunning ?? false,
72
73
  installCommandRunning: data?.installCommandRunning ?? false,
73
74
  serverStarting: false
74
75
  });
75
76
  }
77
+ setWasLoaded(true);
76
78
  return /* @__PURE__ */ React.createElement(
77
79
  "iframe",
78
80
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freestyle-sandboxes",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
package/src/index.ts CHANGED
@@ -807,7 +807,6 @@ export class FreestyleSandboxes {
807
807
  repoUrl?: string,
808
808
  repoId?: string, repo?: string
809
809
  }) {
810
-
811
810
  function formatHook(serverUrl: string, repoUrl: string) {
812
811
  const hook =
813
812
  serverUrl +
@@ -820,7 +819,7 @@ export class FreestyleSandboxes {
820
819
  client: this.client,
821
820
  body: {
822
821
  // @ts-ignore
823
- repo: repo || repoUrl,
822
+ repo: repoUrl,
824
823
  repoId: repoId,
825
824
  },
826
825
  });
@@ -96,6 +96,8 @@ function FreestyleDevServerInner({
96
96
  return () => clearInterval(interval);
97
97
  }, [data?.ephemeralUrl]);
98
98
 
99
+ const [wasLoaded, setWasLoaded] = React.useState(false);
100
+
99
101
  if (isLoading) {
100
102
  return loadingComponent({
101
103
  devCommandRunning: false,
@@ -104,7 +106,7 @@ function FreestyleDevServerInner({
104
106
  });
105
107
  }
106
108
 
107
- if (!data?.devCommandRunning) {
109
+ if (!data?.devCommandRunning && !wasLoaded) {
108
110
  return loadingComponent({
109
111
  devCommandRunning: data?.devCommandRunning ?? false,
110
112
  installCommandRunning: data?.installCommandRunning ?? false,
@@ -112,6 +114,8 @@ function FreestyleDevServerInner({
112
114
  });
113
115
  }
114
116
 
117
+ setWasLoaded(true);
118
+
115
119
  return (
116
120
  <iframe
117
121
  ref={ref}