Skip to content

Commit

Permalink
Fix resource loading
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Nov 15, 2023
1 parent 7fc45ae commit 0d8fde5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,8 @@ export const WorkspaceFrame = (props: {
const userParam = user == null ? "" : `${user.id}`;
const type = application.subdomain.slice(0, 4);
document.cookie = `workspaceId=${workspace.id};path=/;domain=${domain}`;
if (!applicationDomain) {
// Dev
setFrameUrl(`/testapp`);
} else {
// The frame url must be different for each user and workspace and application so jupyterhub does not return the same ws
setFrameUrl(`//${applicationDomain}/hub/logout`);
setFrameUrl(`//${applicationDomain}/hub/spawn/${userParam}/${workspace.id}${type}${document.location.search ?? ''}`);
if(!frameUrl) {
setFrameUrl(applicationDomain ? `//${applicationDomain}/hub/spawn/${userParam}/${workspace.id}${type}`: `/testapp`);
}
openResource();
}, [currentResource]);
Expand Down
3 changes: 2 additions & 1 deletion applications/osb-portal/src/pages/SampleIframePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const SampleIframePage = () => {
const [fileLoaded, setFileLoaded] = React.useState("");
React.useEffect(() => {
if (window !== window.parent) {
window.parent.postMessage({ type: "APP_READY" }, "*");
setTimeout(() => {
window.parent.postMessage({ type: "APP_READY" }, "*");}, 1000);
}
return () => {};
}, []);
Expand Down

0 comments on commit 0d8fde5

Please sign in to comment.