Skip to content
This repository was archived by the owner on May 19, 2020. It is now read-only.

Commit 720ce5b

Browse files
authored
Merge pull request #492 from 18F/ms-fix_space_page_loading
Fix initial load of space page
2 parents cef7720 + e0f5724 commit 720ce5b

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

static_src/components/space.jsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,30 @@ export default class Space extends React.Component {
7171
];
7272
}
7373

74+
get currentOrgName() {
75+
return this.state.currentOrg ? this.state.currentOrg.name : '';
76+
}
77+
78+
get currentOrgGuid() {
79+
return this.state.currentOrg ? this.state.currentOrg.guid : '0';
80+
}
81+
7482
render() {
7583
let Content = this.currentContent;
7684
let tabNav = <div></div>;
7785
let main = <h4>Space not found</h4>;
7886

7987
if (this.state.space && this.state.space.guid) {
80-
tabNav = (
81-
<Tabnav items={ this.subNav } initialItem={ this.props.currentPage } />
82-
);
88+
if (this.state.currentOrg) {
89+
tabNav = (
90+
<Tabnav items={ this.subNav } initialItem={ this.props.currentPage } />
91+
);
92+
}
8393
main = (
8494
<div>
8595
<div>
8696
<h2>
87-
<strong>{this.state.space.name}</strong> space in your <strong>{ this.state.currentOrg.name }</strong> organization
97+
<strong>{this.state.space.name}</strong> space in your <strong>{ this.currentOrgName }</strong> organization
8898
</h2>
8999
<p><em>
90100
Each <a href="https://docs.cloud.gov/getting-started/concepts/">space</a> provides an environment for related applications (<a href="https://docs.cloud.gov/intro/overview/using-cloudgov-paas/">example use</a>).
@@ -94,7 +104,7 @@ export default class Space extends React.Component {
94104
<div>
95105
<div role="tabpanel" id={ this.props.currentPage }>
96106
<Content
97-
initialOrgGuid={ this.state.currentOrg.guid }
107+
initialOrgGuid={ this.currentOrgGuid }
98108
initialSpaceGuid={ this.state.space.guid }
99109
intitialApps={ this.state.space.apps || [] }
100110
/>

0 commit comments

Comments
 (0)