Skip to content

Commit

Permalink
Fetching prefs needs more work separately
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Allen committed Mar 11, 2017
1 parent d8e7867 commit 4985c17
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/pages/project/index.cjsx
Expand Up @@ -54,14 +54,10 @@ ProjectPageController = React.createClass
userChanged = nextContext.initialLoadComplete and nextProps.user isnt @props.user

# Wait until we know if there's a user
if pathChanged or nextContext.initialLoadComplete
if pathChanged or userChanged or nextContext.initialLoadComplete and @state.project is null
@fetchProjectData owner, name, nextProps.user unless @state.loading
@setupSplits nextProps

if userChanged and nextProps.project?
@getUserProjectPreferences(nextProps.project, nextProps.user)
@setupSplits nextProps

componentWillUpdate: (nextProps, nextState) ->
if nextProps.location.query?.workflow? and @canFetchWorkflowByQuery(nextProps.project, nextProps.user)
@getSelectedWorkflow(nextProps.project, nextState.preferences) unless nextState.loadingSelectedWorkflow
Expand Down Expand Up @@ -91,7 +87,6 @@ ProjectPageController = React.createClass
@context.geordi?.forget ['experiment','cohort']

fetchProjectData: (ownerName, projectName, user) ->
@listenToPreferences null
@setState({
error: null,
loading: true,
Expand Down Expand Up @@ -156,6 +151,8 @@ ProjectPageController = React.createClass
'allow workflow query' in project.experimental_tools or @checkUserRoles(project, user)

getUserProjectPreferences: (project, user) ->
@listenToPreferences null

userPreferences = if user?
user.get 'project_preferences', project_id: project.id
.then ([preferences]) =>
Expand Down

0 comments on commit 4985c17

Please sign in to comment.