@@ -82,18 +82,18 @@ const MobileIDEView = (props) => {
82
82
// Force state reset
83
83
useEffect ( clearPersistedState , [ ] ) ;
84
84
useEffect ( stopSketch , [ ] ) ;
85
- useEffect ( ( ) => getProject ( params . project_id ) , [ ] ) ;
86
85
87
86
// Load Project
88
87
const [ currentProjectID , setCurrentProjectID ] = useState ( null ) ;
89
88
useEffect ( ( ) => {
89
+ if ( ! username ) return ;
90
90
if ( params . project_id && ! currentProjectID ) {
91
91
if ( params . project_id !== project . id ) {
92
- getProject ( params . project_id ) ;
92
+ getProject ( params . project_id , params . username ) ;
93
93
}
94
94
}
95
95
setCurrentProjectID ( params . project_id ) ;
96
- } , [ params , project ] ) ;
96
+ } , [ params , project , username ] ) ;
97
97
98
98
99
99
return (
@@ -269,7 +269,10 @@ MobileIDEView.propTypes = {
269
269
270
270
getProject : PropTypes . func . isRequired ,
271
271
clearPersistedState : PropTypes . func . isRequired ,
272
- params : PropTypes . shape ( { project_id : PropTypes . string } ) . isRequired ,
272
+ params : PropTypes . shape ( {
273
+ project_id : PropTypes . string ,
274
+ username : PropTypes . string
275
+ } ) . isRequired ,
273
276
} ;
274
277
275
278
function mapStateToProps ( state ) {
0 commit comments