File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -161,21 +161,19 @@ const reducer = function (state, action) {
161161 return state ;
162162 case SET_PROJECT_ID :
163163 // if we were already showing a project, and a different projectId is set, only fetch that project if
164- // projectId is a valid id, and projectId has changed. This prevents re-fetching projects unnecessarily.
165- if ( action . id !== null && action . id !== '' && typeof action . id !== 'undefined' ) {
166- if ( state . loadingState === LoadingState . SHOWING_WITH_ID ) {
167- if ( state . projectId !== action . id ) {
168- return Object . assign ( { } , state , {
169- loadingState : LoadingState . FETCHING_WITH_ID ,
170- projectId : action . id
171- } ) ;
172- }
173- } else { // allow any other states to transition to fetching project
164+ // projectId has changed. This prevents re-fetching projects unnecessarily.
165+ if ( state . loadingState === LoadingState . SHOWING_WITH_ID ) {
166+ if ( state . projectId !== action . id ) {
174167 return Object . assign ( { } , state , {
175168 loadingState : LoadingState . FETCHING_WITH_ID ,
176169 projectId : action . id
177170 } ) ;
178171 }
172+ } else { // allow any other states to transition to fetching project
173+ return Object . assign ( { } , state , {
174+ loadingState : LoadingState . FETCHING_WITH_ID ,
175+ projectId : action . id
176+ } ) ;
179177 }
180178 return state ;
181179 case START_FETCHING_NEW_WITHOUT_SAVING :
You can’t perform that action at this time.
0 commit comments